路由顯示報(bào)錯(cuò)TypeError: Cannot read property 'location' of undefined
滿(mǎn)滿(mǎn)的干貨。謝謝老師,好期待老師再出一個(gè)react + redux的課程 O(∩_∩)O。路由顯示一直報(bào)錯(cuò)不知道怎么解決,頁(yè)面顯示錯(cuò)誤:TypeError: Cannot read property 'location' of undefined;控制臺(tái)顯示:main.js:826 Warning: Failed prop type: The prop `history` is marked as required in `Router`, but its value is `undefined`. 裝的是"react-router": "^2.0.0"。有遇到的小伙伴嗎?大家怎么解決的呢?
2017-09-13
查看一下package.json中dependencies中的react-router的版本,老師所講的支持的是不是最新4的版本