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)
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 react-redux#6.0.0.
My project version is greater than 16.5.0 but I am unsure if this also has an impact or not.
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 react#16.5.0".
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
Try using react 16.6.0 instead of 16.5.0
This is issue with expo.Try to clear expo cache by using this command
expo r -c
Try update your dependencies.
I have the same problem and I'm using npm-check-updates.
Here's a update check log:
expo ^32.0.0 → ^32.0.6
react 16.5.0 → 16.8.6
react-navigation ^3.6.1 → ^3.7.1
babel-preset-expo ^5.0.0 → ^5.1.1
Run npm install to install new versions.
If you are feeling lost and shelterless while trying to implement a modern React-Native inside Expo app, do not worry my friend, you are not alone.
I had this problem and found that:
expo 32.0 does not support react 16.8
react-redux 7.1 and on require react 16.8
I was able to make it work with this set of versions:
"expo": "^32.0.0",
"react": "16.5.0",
"react-redux": "^6.0.1",
You can replace them in your package.json, then you should do:
> rm -rf node_modules
> [npm|yarn] install
> expo r -c
In order to remove previous versions from node_modules and Expo cache.
To combine the two answers that solved it for me:
Remove new react-redux: yarn remove react-redux
Install the older version of react-redux: yarn add react-redux#6.0.1
Clear expo cache: expo r -c
That will do the trick.
Related
I'm working on a react project in typescript (react version 16.12.0) and I would like to add React Testing Library to this. The newer versions of react comes with React-Testing-Library but the project I'm working on doesn't come with RTL, so I installed it manually.
I added the below to package.json and did yarn install
"#types/testing-library__react": "^10.2.0",
When I did yarn start, I get this error below
Other related packages versions used
"#types/react": "~16.9.14",
"typescript": "3.4.5",
"react-scripts": "^3.0.0",
The issue was occurring with the typescript version. After some research, I found that for react-testing-library to work with typescript, the TS version needs to be updated to 3.8 and above.
After updating typescript version to 3.8 and fixing some of the errors caused by this update, I was able to resolve this error.
i actualize the node_module by doing nom install, then the doesn't work again and I became this error: Unable to resolve module react-native/Libraries/Components/ScrollResponder from /Users/project/node_modules/deprecated-react-native-listview/index.js: react-native/Libraries/Components/ScrollResponder could not be found within the project or in these directories:
node_modules
../node_modules.
in Package.json I have this version of react-native
"react": "^17.0.2",
"react-native": "^0.66.0",
...
Please help me I am a beginner, thanks a lot
I had this problem with version 0.0.6 of deprecated-react-native-listview but version 0.0.7 has a fix for this.
I take a look at react-native source code and I realized that ScrollResponder component was removed when react-native v0.65. Your react-native version is 0.66.0 therefore get this error.
Check the diff react-native v0.64 with v0.65 here: https://github.com/facebook/react-native/compare/0.64-stable...0.65-stable
You can consider downgrading your react-native version or use an alternative component instead of deprecated-react-native-listview.
I wonder what the update strategy for expo is when using expo-cli.
F.e. my package currently consists of these packages:
"expo": "39.0.4",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
"react-native-gesture-handler": "1.7.0",
"react-native-reanimated": "1.13.1",
"react-native-web": "0.14.8",
Normally when i do default react applications i just add renovate-bot to my repo and update everything all the time. Things seem to be different when using expo. Some questions:
When i updated react-native-gesture-handler or react-native-reanimated i got warnings when running expo start that these versions are out of range for my currently running expo package. Is it correct that i should not update those dependend packages until expo releases an update?
When i updated react to 17 no such warning popped up, so it seems expo is fine when i run newer version of react? (although i had other runtime warnings pop up related to it)
Why is react-native fixed to this specific version? I guess because expo expects an exact version? Is this when expo upgrade should be used once a new expo version gets released?
Thanks for answering any of these questions.
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
you're using wrong version of React, React.memo is introduced with version 16.6.0 so, try this command to install the right version
npm install --save react#16.6.0 react-dom#16.6.0
for more info click here
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.
That's because #material-ui/styles has a peer dependency on react >= 16.7.0-alpha.0 and react-dom >= 16.7.0-alpha.0 that include hooks.
To use #material-ui/styles, change your react and react-dom dependencies like this:
"dependencies": {
...
"react": "^16.7.0-alpha.2",
"react-dom": "^16.7.0-alpha.2",
...
},
Find out which version of react-redux version you are using and then go to https://react-redux.js.org/versions. Click on the documentation associated with your version. You should see something like this:
Installation
React Redux 7.1 requires React 16.8.3 or later.
Update your react in package.json to the appropriate version and install.
I'm using create-react-app and have updated react and react-dom to later versions, yet when I console log the version of react being used, it's still showing an older version.
package.json
"react": "^16.3.0",
...
"react-dom": "^16.3.0",
Then I log the version used:
console.log('React.version', React.version);
And it tells me:
React.version 15.6.2
How can I get create-react-app to use the newer version?
Reason for update, I want to use React Context which is only available from version 16.3.0+