随笔分类 -  react

export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' 使用react-router时报错!
摘要:解决方案: 将react-router版本降到5即可 阅读全文

posted @ 2022-02-19 16:02 昼日萤火 阅读(2698) 评论(0) 推荐(0)

react中使用编程式导航报错: Detail.jsx:5 Uncaught TypeError: Cannot read properties of undefined
摘要:Detail.jsx:5 Uncaught TypeError: Cannot read properties of undefined 原因是在未定义路由的组件中使用了编程式导航 解决方法: import {withRouter} from 'react-router-dom' class Det 阅读全文

posted @ 2022-02-18 19:54 昼日萤火 阅读(127) 评论(0) 推荐(0)

导航