为了账号安全,请及时绑定邮箱和手机立即绑定

react-router 引入hashHistory 为何为undefined

react-router 引入hashHistory 为何为undefined

chenzhizhuo 2017-09-03 21:16:13
import {Router,Link,Route,hashHistory} from 'react-router'console.log(hashHistory) => undefined  ?console.log(Route)  => 输出正确dependencies 中已安装 "react-router": "^4.1.2",  页面运行正常,就是引入react-router 会异常这是为何?defined21: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
查看完整描述

8 回答

  • 8 回答
  • 0 关注
  • 14716 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信