Skip to content

Commit d13a61a

Browse files
committed
[docs] clarify the component/RouteResolver distinction
1 parent c335aa7 commit d13a61a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/route.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ Argument | Type | Required | Description
147147

148148
#### RouteResolver
149149

150-
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.
150+
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.
151+
152+
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.
153+
154+
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.
151155

152156
`routeResolver = {onmatch, render}`
153157

0 commit comments

Comments
 (0)