Migrate React version

Viewed 75

Is there any tool that would help me to migrate any React version to another? Something like React Native Upgrade Helper but for React.

1 Answers

I don't think it is really required for React. Unlike React Native there are no gradle or podfiles. The process is much simpler.

Just run npm i react react-dom react-scripts or yarn add react react-dom react-scripts to get the latest version of React and react-scripts (if you are using that).

If you are using Typescript you might want to update @types/react too.

Some other packages might need updating but this will be a similar flow to updating other packages with React Native that is not covered by the update helper.

You can run npm outdated or yarn outdated to see any available package updates.

React 17

React 17 had a some specific update requirements that you can read about here.

Related