Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement