Created
August 15, 2019 21:20
-
-
Save imjakechapman/6b56df4ad66c3c66862f34198f70c787 to your computer and use it in GitHub Desktop.
Location State
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Example = () => ( | |
| <Router> | |
| <h1>Location State Example</h1> | |
| <Route> | |
| {({ location }) => { | |
| <Switch> | |
| <Location state={null} component={Page1} /> | |
| <Location state="page2" component={Page2} /> | |
| <Location state="page3" component={Page3} /> | |
| <Location component={NotFound} /> | |
| </Switch> | |
| }} | |
| </Route> | |
| </Router> | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment