React.default.memo is not a function (React-Native) wrapWithConnect

phaseharry picture phaseharry · Apr 11, 2019 · Viewed 11.8k times · Source

I get this the error

_react.default.memo is not a function

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:

Package Versions:

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

code

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

export default connect(null, mapDispatchToProps)(Login)

Answer

moi paslui picture moi paslui · Apr 11, 2019

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 [email protected].

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