Skip to content

Instantly share code, notes, and snippets.

@radzserg
Last active July 10, 2019 08:57
Show Gist options
  • Select an option

  • Save radzserg/1a2c3b73a65ec36ccb00711555776128 to your computer and use it in GitHub Desktop.

Select an option

Save radzserg/1a2c3b73a65ec36ccb00711555776128 to your computer and use it in GitHub Desktop.
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