How to update the React version of the old project to the latest version

I have a small project I did before. At that time, react was still 15 + version. Now I want to update the version to the latest 16. How to modify it? change the number directly in package.json, delete node_module, and re-npm install it?

Jan.11,2022

npm install react@

also remember to delete package-lock.json or yarn-lock

in addition, the v4 version of router has a great impact on v3, and it will take some time to change it

Menu