-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add an example on how to use the onEnter callback #3660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This change adds an example on how to use the onEnter callback to redirect a user to another page.
docs/API.md
Outdated
`cb(err)` | ||
|
||
```js | ||
const userIsInAnOrganisation = (nextState, replace, callback) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the awful tiny nit, but I think we generally use AmE for docs, to the extent it matters. Maybe this could just be userIsInAnOrg
?
Thanks! Left a couple quick notes. |
I've addressed your notes! I renamed "organisations" to "teams" to avoid any unnecessary contention in spelling. |
docs/API.md
Outdated
}) | ||
} | ||
|
||
<Route path="/users/:userId/teams" onEnter={userIsInAnTeam} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
userIsInATeam
Sorry, a couple more notes. Thanks for updating the docs – this is a great help |
Thanks again! |
This change adds an example to the documentation on how to use the onEnter callback to redirect a user to another page.