
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Check the Version of ReactJS
ReactJS is a frontend library of JavaScript to build efficient Single Page Application(SPA). Each version of React comes with some improvements and added features. So, it is very important to know which version we are using.
Approaches to Check React Version
We can check the version of ReactJS by using the below-mentioned Approaches.
- Using Command Line
- Using ?React.version' Property
- Searching in dependencies in package.json
React Version Using Command Line
We can use the below command to check the version of ReactJS. The below command shows the installed react version in our system.
npm view react version
React Version Using React.version Property
We can use the 'React.version' property to check the version of ReactJs installed in our system. The code mentioned below can be used to check the version of React using React.version property.
// file name - app.js import React from "react"; const App = () => { return <h1> We are currently using {" "}{React.version} version of ReactJS </h1>; }; export default App;
React Version Searching in package.json File
Apart from the two approaches mentioned above, we can simply search in our project's package.json folder to find the version of ReactJs we are using. Go to package.json file of the project then there will be a dependencies section, and the ReactJS version will be written there.
In the below image, we can see that the react version is "18.3.1" in the dependencies section.