React-router TypeError: _this.props.history is undefined

后端 未结 11 2151
旧时难觅i
旧时难觅i 2020-12-15 16:07

I am using react-router with react js and i following their documentation but facing this error

while compiling it shows the error,

TypeError: _this.         


        
11条回答
  •  Happy的楠姐
    2020-12-15 17:05

    Are you using npm? I had the same problem with "react-router": "^4.0.0" in my package.json. Changing it to "react-router": "^3.0.2" solved my problem.

提交回复
热议问题