by Sai gowtham

How to check the React version Quickly

In this tutorial, we are going to learn about multiple ways to check the (current) react version we are using in our project.

Using the React.version property

We can use the React.version property to check the current react version from a component.

Example:

App.js
import React from "react";
import "./styles.css";

export default function App() {
  return (
    <div className="App">
      <h1>Current version is {React.version}</h1>    </div>
  );
}

Using the Terminal

Inside the terminal, we can check the react version by running the following (npm) command.

npm list react

Output:

react@16.13.1

or you can view the react version by opening a package.json file in your project.

package.json
{
  "name": "react",
  "version": "1.0.0",
  "description": "React example starter project",
  "keywords": [
    "react",
    "starter"
  ],
  "main": "src/index.js",
  "dependencies": {
    "react": "16.13.1",    "react-dom": "16.13.1",

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course