Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Last active August 28, 2015 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanflorence/b3cb84b3738d37106c6d to your computer and use it in GitHub Desktop.
Save ryanflorence/b3cb84b3738d37106c6d to your computer and use it in GitHub Desktop.
class App extends React.Component {
componentDidMount () {
history.listen((location) => {
this.props.dispatch({ type: 'ROUTE_CHANGE', location })
})
},
render () {
return (
<RoutingContext
routes={routes}
location={this.props.location}
/>
)
}
}
export default connect(state => ({ location }))(App)
// then in index.js
React.render((
<Provider store={store}>{() => <App/>}</Provider>
), appEl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment