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

This above command work on both mac and windows based operating systems.

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 2021 (Beginner + Advanced)
JavaScript - The Complete Guide 2021 (Beginner + Advanced)
64,026 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 - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
152,857 students enrolled
48.5 hours of video content
View Course