【问题标题】:react-router-redux - syncHistoryWithStore seems to be missingreact-router-redux - syncHistoryWithStore 似乎丢失了
【发布时间】:2017-09-08 18:44:38
【问题描述】:

我下载了一个 react 路由器和 redux 教程(如果你知道的话,来自 https://learnredux.com/)并开始使用它。我想将我的代码从 facebook (https://facebook.github.io/react/docs/installation.html) 复制到标准应用程序中。虽然我安装了所有的依赖项,但我没有让它工作。

尝试了很多console.log()我发现syncHistoryWithStore 给了我一个undefined

我对 npm 和类似的东西很陌生,来自纯 html。是否有一种智能方法可以跟踪我的问题、检查我丢失的依赖项或解决此类问题所需的任何方法?

感谢您的帮助。

【问题讨论】:

标签: reactjs npm react-router react-redux react-router-redux


【解决方案1】:

我正在学习相同的教程。我用的时候:

import { syncHistoryWithStore } from 'react-router-redux';

代替:

import { syncHistoryWithStore } from 'react-router';

它开始工作了。我希望这会有所帮助。

【讨论】:

  • 谢谢。我试过这个,它似乎有帮助,但我也不得不改变很多其他的东西。现在react好像这行代码有问题export const history = syncHistoryWithStore(browserHistory, store);
猜你喜欢
  • 2017-09-28
  • 2017-05-19
  • 1970-01-01
  • 2016-09-27
  • 2018-07-13
  • 2016-09-28
  • 1970-01-01
  • 2018-07-06
  • 2020-04-29
相关资源
最近更新 更多