These are my current dependencies:
react": "^17.0.1",
"react-dom": "^17.0.1",
"react-popper": "^1.3.7",
"redux": "^3.7.2"
This is the error
As the document suggests:
"As of React Native 0.18, React Redux 5.x should work with React Native. If you have any issues with React Redux 5.x on React Native, run npm ls react and make sure you don’t have a duplicate React installation in your node_modules. We recommend that you use npm#3.x which is better at avoiding these kinds of issues."
Related
I recently upgraded React and several other packages to their latest versions, and every since, have been seeing warning messages in my Chrome console referring to bundled files instead of mapped files.
Example: at SelectInput (http://localhost:3000/static/js/bundle.js:119921:25) instead of at SelectInput (Select.tsx:123)
I'm using the latest versions of chrome and React Devtools.
Here are my dependency versions in package.json:
dependencies {
"#babel/runtime": "^7.18.3",
"#emotion/react": "^11.9.0",
"#emotion/styled": "^11.8.1",
"#types/node": "^15.12.2",
"#types/react": "^18.0.12",
"#types/react-dom": "^18.0.5",
"react": "^18.1.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"typescript": "^4.7.3"
}
I see this older solution Console logging error on bundle.js instead of React component but cannot find webpack.config.js to make updates, nor am I sure if it applies to these newer package updates.
How can I see the mapped file names in the chrome console?
I have found that webpack is default installed in create-react-app.
And I found that installing rewire allows at least to modify the webpack configuration.
That is not yet the full solution, but at least one step.
I am trying to use Chart.js zoom in react and I keep getting this error.
Here are my dependencies
"dependencies": {
"chart.js": "^2.9.4",
"chartjs-plugin-zoom": "^1.2.0",
"patternomaly": "^1.3.2",
"react": "^15.6.1",
"react-chartjs-2": "^2.1.0",
"react-dom": "^15.6.1"
},
As described in the readme of the zoom plugin you need to use version 0.7.7 if you want to use it together with Chart.js V2. If you want to use the latest version of zoom you will need to update Chart.js to V3 but this has a lot of major breaking changes
For Chart.js 2.6.0 to 2.9.x support, use version 0.7.7 of this plugin.
To install a specific version of a lib you can specify it after it like so:
npm install chartjs-plugin-zoom#0.7.7
I am writing applications with React Native. I am using Expo.
My React and react-dom versions are 17.0.0 but I get an error like this on the expo web page. How can I solve the problem?
"react": "17.0.0",
"react-dom": "17.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",
It is showing as follow:
According to your console warning, instead of
'componentWillMount'
you should give
'componentDidMount'
I have used CRA on a project for 2 years now.
Currently, my packages are on the following outdated versions but I want to update to React 16.8 because it's a peer-dependency for a lot of npm packges I want to use.
"react": "^16.8.0",
"react-dom": "^16.8.0",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.0",
Can I safely update react and react-dom to 16.8 without updating react-scripts?
Note, I tried updating CRA (react-scripts) to 2.x.x recently and it caused a bunch of my older libraries to fail.
I wouldn't recommend, unless there is a need on it. (Like a security breach)
You probably will find some compatibility issues, and for this to work, you will need to update your dependencies.
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.