Last active
July 10, 2019 08:57
-
-
Save radzserg/1a2c3b73a65ec36ccb00711555776128 to your computer and use it in GitHub Desktop.
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
| class App extends PureComponent { | |
| render() { | |
| const browserHistory = createBrowserHistory(); | |
| return ( | |
| <Router history={browserHistory}> | |
| <Switch> | |
| <Route path="/" component={HomePage} exact={true} /> | |
| </Switch> | |
| </Router> | |
| ); | |
| } | |
| } | |
| interface IProps { | |
| history: History | |
| } | |
| class HomePage extends PureComponent<IProps> { | |
| render() { | |
| return ( | |
| <button onClick={this.props.history.push("/catalog")}>Catalog</button> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment