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.