Skip to content

Instantly share code, notes, and snippets.

@indapublic
Created March 24, 2017 15:20
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 indapublic/952572853cfbe8b89e671df8794feb4d to your computer and use it in GitHub Desktop.
Save indapublic/952572853cfbe8b89e671df8794feb4d to your computer and use it in GitHub Desktop.
App.js
import { Router, Route, IndexRoute, browserHistory } from 'react-router'
render() {
return (
<Router history={browserHistory}>
<Route path="/" component={Main}>
<IndexRoute component={Home} />
<Route path="*" component={NotFound} status={404} />
</Route>
</Router>
)
}
Home.js:
class Home extends Component {
componentWillReceiveProps(nextProps) {
console.log(this.props.location.query)
console.log(nextProps.location.query)
}
}
export default connect(state => ({
home: state.home
}), dispatch => ({
homeActions: bindActionCreators(homeActions, dispatch)
}))(Home)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment