Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. App.js
  2.  
  3. import { Router, Route, IndexRoute, browserHistory } from 'react-router'
  4.  
  5. render() {
  6. return (
  7. <Router history={browserHistory}>
  8. <Route path="/" component={Main}>
  9. <IndexRoute component={Home} />
  10. <Route path="*" component={NotFound} status={404} />
  11. </Route>
  12. </Router>
  13. )
  14. }
  15.  
  16. Home.js:
  17.  
  18. class Home extends Component {
  19.  
  20. componentWillReceiveProps(nextProps) {
  21. console.log(this.props.location.query)
  22. console.log(nextProps.location.query)
  23. }
  24.  
  25. }
  26.  
  27. export default connect(state => ({
  28. home: state.home
  29. }), dispatch => ({
  30. homeActions: bindActionCreators(homeActions, dispatch)
  31. }))(Home)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement