[docs] clarify the component/RouteResolver distinction
This commit is contained in:
parent
c335aa70ca
commit
d13a61a4d8
1 changed files with 5 additions and 1 deletions
|
|
@ -147,7 +147,11 @@ Argument | Type | Required | Description
|
|||
|
||||
#### RouteResolver
|
||||
|
||||
A RouteResolver is an object that contains an `onmatch` method and/or a `render` method. Both methods are optional, but at least one must be present. A RouteResolver is not a component, and therefore it does NOT have lifecycle methods. As a rule of thumb, RouteResolvers should be in the same file as the `m.route` call, whereas component definitions should be in their own modules.
|
||||
A RouteResolver is an non-component object that contains an `onmatch` method and/or a `render` method. Both methods are optional, but at least one must be present.
|
||||
|
||||
If an object can be detected as a component (by the presence of a `view` method or by being a `function`/`class`), it will be treated as such even if it has `onmatch` or `render` methods. Since a RouteResolver is not a component, it does not have lifecycle methods.
|
||||
|
||||
As a rule of thumb, RouteResolvers should be in the same file as the `m.route` call, whereas component definitions should be in their own modules.
|
||||
|
||||
`routeResolver = {onmatch, render}`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue