Skip to content

Commit

Permalink
Remove docs on context.router
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Sep 23, 2019
1 parent 51325d8 commit 8f49b02
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
5 changes: 0 additions & 5 deletions packages/react-router/docs/api/context.router.md

This file was deleted.

18 changes: 11 additions & 7 deletions packages/react-router/docs/api/match.md
Expand Up @@ -24,7 +24,7 @@ A `<Route>` that uses the `children` prop will call its `children` function even
The default way to "resolve" URLs is to join the `match.url` string to the "relative" path.

```js
;`${match.url}/relative-path`
let path = `${match.url}/relative-path`
```

If you attempt to do this when the match is `null`, you will end up with a `TypeError`. This means that it is considered unsafe to attempt to join "relative" paths inside of a `<Route>` when using the `children` prop.
Expand All @@ -33,12 +33,16 @@ A similar, but more subtle situation occurs when you use a pathless `<Route>` in

```js
// location.pathname = '/matches'
<Route path='/does-not-match' children={({ match }) => (
// match === null
<Route render={({ match:pathlessMatch }) => (
// pathlessMatch === ???
)}/>
)}/>
<Route path="/does-not-match"
children={({ match }) => (
// match === null
<Route
render={({ match: pathlessMatch }) => (
// pathlessMatch === ???
)}
/>
)}
/>
```

Pathless `<Route>`s inherit their `match` object from their parent. If their parent `match` is `null`, then their match will also be `null`. This means that a) any child routes/links will have to be absolute because there is no parent to resolve with and b) a pathless route whose parent `match` can be `null` will need to use the `children` prop to render.
1 change: 0 additions & 1 deletion website/modules/docs/Core.js
Expand Up @@ -8,7 +8,6 @@ export default {
require("../../../packages/react-router/docs/api/Router.md"),
require("../../../packages/react-router/docs/api/StaticRouter.md"),
require("../../../packages/react-router/docs/api/Switch.md"),
require("../../../packages/react-router/docs/api/context.router.md"),
require("../../../packages/react-router/docs/api/history.md"),
require("../../../packages/react-router/docs/api/location.md"),
require("../../../packages/react-router/docs/api/match.md"),
Expand Down

0 comments on commit 8f49b02

Please sign in to comment.