V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hao0607
V2EX  ›  问与答

react router 使用出现报错

  •  
  •   hao0607 · 2017 年 11 月 1 日 · 4441 次点击
    这是一个创建于 3015 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Uncaught TypeError: Cannot read property 'func' of undefined
    at Object../node_modules/[email protected]@react-router/lib/InternalPropTypes.js (InternalPropTypes.js:9)
    at __webpack_require__ (bootstrap 7fbd0ef …:669)
    at fn (bootstrap 7fbd0ef …:87)
    at Object../node_modules/[email protected]@react-router/lib/PropTypes.js (PropTypes.js:12)
    at __webpack_require__ (bootstrap 7fbd0ef …:669)
    at fn (bootstrap 7fbd0ef …:87)
    at Object../node_modules/[email protected]@react-router/lib/index.js (index.js:15)
    at __webpack_require__ (bootstrap 7fbd0ef …:669)
    at fn (bootstrap 7fbd0ef …:87)
    at Object../src/App.js (App.css?8811:26)
    at __webpack_require__ (bootstrap 7fbd0ef …:669)
    at fn (bootstrap 7fbd0ef …:87)
    at Object../src/index.js (index.css?06e0:26)
    at __webpack_require__ (bootstrap 7fbd0ef …:669)
    at fn (bootstrap 7fbd0ef …:87)
    at Object.0 (myTab.js:69)
    at __webpack_require__ (bootstrap 7fbd0ef …:669)
    at bootstrap 7fbd0ef …:715
    at bundle.js:719


    上面是我使用 react 路由出现的报错 大神们 知道什么原因吗?本人 react 小白一枚,刚学习 react
    3 条回复    2017-11-03 18:44:29 +08:00
    vardarling
        1
    vardarling  
       2017 年 11 月 1 日
    从 prop-types 引入 PropTypes
    xiaonizi
        2
    xiaonizi  
       2017 年 11 月 1 日
    前两天同事也出现过这个问题,检查一下 react 版本
    Rico
        3
    Rico  
       2017 年 11 月 3 日
    我也遇到了这个问题。react16 的不能兼容 react-router 2/3 如果要用 react-router2/3,需将 react 降级到 15
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5127 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 02:58 · PVG 10:58 · LAX 18:58 · JFK 21:58
    ♥ Do have faith in what you're doing.