快捷导航

react-router 引入hashHistory 为何为undefined

import {Router,Link,Route,hashHistory} from 'react-router'
console.log(hashHistory) => undefined  ?
console.log(Route)  => 输出正确


dependencies 中已安装 "react-router": "^4.1.2",  页面运行正常,就是引入react-router 会异常这是为何?
defined
21:09:52.562 main.js:826 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of `Root`.
21:09:52.566 main.js:826 Warning: Failed prop type: The prop `history` is marked as required in `Router`, but its value is `undefined`.
ght TypeError: Cannot read property 'location' of undefined

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP