__WEBPACK_IMPORTED_MODULE_4_react ___ default.a.memo不是函数 [英] __WEBPACK_IMPORTED_MODULE_4_react___default.a.memo is not a function

查看:52
本文介绍了__WEBPACK_IMPORTED_MODULE_4_react ___ default.a.memo不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是将应用程序与redux和react-redux连接功能以及状态和调度连接在一起。它编译没有问题,但是结果没有显示。

我试图找到它,发现我必须更改react版本。

  $ sudo npm install --save react@16.4.0 react-dom@16.4.0 

但是没有用。



我正在关注本教程。



解决方案

这也发生在我身上。当依赖项版本得到更新并且观看的YouTube视频的依赖项具有旧版本时,就会发生这种情况。


因此,请替换包中的以下依赖项。 json 文件:

  react: ^ 16.4.1,
react -dom: ^ 16.4.1,
react-redux: ^ 5.0.7,
react-router-dom: ^ 4.3.1 ;,
redux: ^ 4.0.0&,
redux-thunk: ^ 2.3.0&,

并运行 npm install


由于 connect()函数将React组件连接到Redux存储,
react,redux 需要版本支持。如果您愿意使用最新的依赖项,请参阅 Redux 文档。


以上方法应该可以解决您的问题。


I just connect the app with redux and react-redux connect function, together with state and dispatches. It compiled without problems but the results are not showing. And it looks like below.

I tried to find it and found that i have to change react version.

$ sudo npm install --save react@16.4.0 react-dom@16.4.0

But it didn't work.

I am following this tutorial. https://www.youtube.com/watch?v=BxzO2M7QcZw

解决方案

This had happened to me as well. This happens when dependencies version gets updated, and the dependencies of the YouTube video you are watched has an old version.

Hence, replace the following dependencies in the package.json file:

"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0",

and run npm install.

Since the connect() function connects a React component to a Redux store, react, redux need to be version supported. If you are willing to use newest dependencies please refer the Redux documentation.

The above method should solve your problem.

这篇关于__WEBPACK_IMPORTED_MODULE_4_react ___ default.a.memo不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆