You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Route matching happens in the order they are defined (think `if/elseif` statement). In this case, `/about/me` will show the `UserPage` component because `/about/me` matches the first route. You need to reorder your routes if this happens.
32
-
`About` will never be reachable:
34
+
35
+
Route matching happens in the order they are defined (think `if/elseif` statement). In this case, `/about/me` will show the `<UserPage>` component because `/about/me` matches the first route. You need to reorder your routes if this happens. `<About>` will never be reachable:
### "Required prop was not specified" on route components
55
+
56
+
You might see this if you are using `React.cloneElement` to inject props into route components from their parents. If you see this, remove `isRequired` from `propTypes` for those props. This happens because React validates `propTypes` when the element is created rather than when it is mounted. For more details, see [facebook/react#4494](https://github.com/facebook/react/issues/4494#issuecomment-125068868).
57
+
58
+
You should generally attempt to use this pattern as sparingly as possible. In general, it's best practice to minimize data dependencies between route components.
59
+
60
+
61
+
### `<noscript>` with server-side rendering and async routes
62
+
63
+
Use `match({ history, routes })` on the client side. See [the server rendering guide](guides/ServerRendering.md#async-routes).
64
+
65
+
66
+
### Passing additional values into route components
67
+
68
+
There are multiple ways to do this depending on what you want to do. You can:
69
+
70
+
- Define additional values on `<Route>` or the plain route. This will make those values available on `this.props.route` on route components.
71
+
- Pass in a `createElement` handler to `<Router>` or `<RouterContext>`. This will allow you to inject additional props into route elements at creation time.
72
+
- Define a top-level component above `<Router>` or `<RouterContext>` that exports additional values via `getChildContext`, then access them via context from rendered components.
Because the server has no DOM available, the history singletons (`browserHistory` and `hashHistory`) do not function on the server. Instead, they will simply return `undefined`.
0 commit comments