React this.props.params undefined

后端 未结 6 1217
名媛妹妹
名媛妹妹 2021-02-07 03:15

I have problem passing id to my page with product, I tried everything and search answer but it still doesn\'t work.

Here is my index.js:

impor         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-07 03:59

    I use

    import { Router, Route, browserHistory, IndexRoute} from 'react-router'
    

    and

    import {syncHistoryWithStore, routerReducer} from 'react-router-redux'
    

    then I can get id by this.props.params.id

提交回复
热议问题