Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)
like image 636
phaseTiny Avatar asked Apr 11 '19 04:04

phaseTiny


4 Answers

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

You can change the 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.

like image 186
moi paslui Avatar answered Nov 19 '22 17:11

moi paslui


Had this exact same error. Realised it's not due to syntax errors, but the react-redux version compabitility. Once I ran yarn check, it gave me multiple messages that "react-redux#react@^16.8.4 does not satisfy found match of [email protected]".

Expo is react 16.5.0 while react-redux expects react version 16.8.4 . As moi answered, installing react-redux 6.0.0 worked for me. Trying to change any other package caused even more errors to appear

like image 35
Deluxe Grove Avatar answered Nov 19 '22 16:11

Deluxe Grove


Try using react 16.6.0 instead of 16.5.0

like image 5
Yossi Avatar answered Nov 19 '22 16:11

Yossi


This is issue with expo.Try to clear expo cache by using this command

expo r -c

like image 4
jyotishman saikia Avatar answered Nov 19 '22 17:11

jyotishman saikia