react-router4中不支持直接从react-router中引用hashHistory等history对象。

解决:

1、降级

npm install react-router@3 --save

2、查阅react-router4的文档

npm install react-router-dom --save

import { hashHistory } from "react-router-dom"

当觉得怎么都不对的时候,终极大法:删除node_modules,然后npm cache clean -f 强制删除缓存,重新npm install 即可。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案