4

I have a project created with Create React App. The documentation regarding how to update the React version seems to be pretty poor.

There is some documentation here https://facebook.github.io/create-react-app/docs/updating-to-new-releases . This seems ambiguous though - are these instructions just to update CRA itself and react-scripts? I have followed the instructions - my react-scripts is up to date at v2.1.1, but my React version is only 16.5.2 - I need 16.6 for a certain feature.

2
  • As per my knowledge, react-scripts internally uses react package. For every react package, react-scripts updates (by community). So if you want to externally use react package you need to eject from CRA and use that. Commented Nov 22, 2018 at 10:30
  • So react-scripts updates the React version? If so, how do I then use it? This is all really unclear. Commented Nov 22, 2018 at 10:55

2 Answers 2

7

Updating react-scripts will not update your React version, you need to do that yourself by updating both react and react-dom (must be the same). Check this and this. I was confused about this too!

Sign up to request clarification or add additional context in comments.

Comments

0

Along with updating react and react-dom you will also need to update some of the other libraries too like react-router-dom.

If the other libraries are not upgraded it may cause conflicts between library versions while installing node modules.

so while migrating react application to new version you should also update other library versions and change node js version to latest recommanded too.

And after the updates you will need to make some of the changes in your code. for Ex. Routing structure, and check if any hooks or inbuilt features are not removed by react.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.