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
Copy file name to clipboardExpand all lines: docs/Troubleshooting.md
+40-10Lines changed: 40 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,17 +88,47 @@ You should generally attempt to use this pattern as sparingly as possible. In ge
88
88
89
89
### Passing additional values into route components
90
90
91
-
There are multiple ways to do this depending on what you want to do. You can:
92
-
93
-
- Define additional values on `<Route>` or the plain route. This will make those values available on `this.props.route` on route components.
94
-
- Pass in a `createElement` handler to `<Router>` or `<RouterContext>`. This will allow you to inject additional props into route elements at creation time.
95
-
- Pass in a `render` handler to `<Router>` with the result of `applyRouterMiddleware`, using a middleware such as:
You can export React context on a top-level provider component, then access this data throughout the tree on rendered components.
126
+
127
+
```js
128
+
<ExtraDataProvider>
129
+
<Router history={history} routes={routes} />
130
+
</ExtraDataProvider>
100
131
```
101
-
- Define a top-level component above `<Router>` or `<RouterContext>` that exports additional values via `getChildContext`, then access them via context from rendered components.
102
132
103
133
104
134
### `<noscript>` with server-side rendering and async routes
0 commit comments