While working with any technology/framework, We get issue due to version compatibility. So a developer should be always ready to deal with such issues, For that the version of the app should be checked.
In this article, We will see how to check the version locally and globally of the React.js application.
The easiest and shorted way to check the React.js app version is to check it inside the package.json file under the dependencies section.
This is also a very easy way, We can check the version by moving inside file node_modules/react/cjs/react.development.js.
Below command can be used to check the version:
npm view react version
The version can also be checked very easily inside the React Component file. Look at the example below:
For checking, the version of packages inside the React.js application, Below command can be used
npm list --depth 0
List will show like below:
+-- @testing-library/jest-dom@4.2.4
+-- @testing-library/react@9.5.0
+-- @testing-library/user-event@7.2.1
+-- axios@0.19.2
+-- react@16.13.1
+-- react-dom@16.13.1
+-- react-scripts@3.4.1
In this article, We learn about the different ways to check the version of the installed packages.
I hope this article helped you. You can also find other demos of React.js Sample Projects here to start working on enterprise-level applications.
Let me know your thoughts over email at demo.jsonworld@gmail.com. I would love to hear them and If you like this article, share it with your friends.
Thank You!