Created
March 24, 2017 15:20
-
-
Save indapublic/952572853cfbe8b89e671df8794feb4d to your computer and use it in GitHub Desktop.
This file contains 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
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