React.default.memo 不是函数 (React-Native) wrapWithConnect [英] React.default.memo is not a function (React-Native) wrapWithConnect

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

问题描述

我得到这个错误

_react.default.memo 不是函数

_react.default.memo is not a function

wrapWithConnect.
这是一个 react-native 项目,在我使用 connect 函数将我的 dispatch 连接到我的 react 组件之前它运行良好:

and wrapWithConnect.
This is a react-native project and it worked fine before I used the connect function to connect my dispatch into my react component:

软件包版本:

    "react": "16.5.0",
    "react-redux": "^6.0.1",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",

代码

const mapDispatchToProps = dispatch => {
 return { 
  sendEmail: (email, navigateMap) => dispatch(sendEmail, navigateMap))

export default connect(null, mapDispatchToProps)(Login)

推荐答案

我遇到了同样的问题,我将 react-redux 的版本改为 6.0.1使用更新的一个,问题就解决了.

I had the same problem and I changed the version of react-redux to 6.0.1 instead of using a more recent one, and the issue was resolved.

请通过运行以下命令更改版本:

Please change version by running following command:

npm install react-redux@6.0.1.

我的项目版本高于 16.5.0,但我不确定这是否也有影响.

My project version is greater than 16.5.0 but I am unsure if this also has an impact or not.

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

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