Know Version of ReactJS

Create a new react application. Delete all the files from src folder except index.js. Replace the code with the following code

import React from 'react';
import ReactDOM from 'react-dom';

class App extends React.Component {
    render(){
        return(
          <div>React version: {React.version}</div>
        );
    }
}

ReactDOM.render(<App />, document.getElementById('root'));

Below is the output of above code.

Output is subject to change as per the ReactJS version you are using.

Unknown's avatar

Author: Akanksha Gupta

I am a developer and working on SharePoint and Project Server in an MNC. I have more than 10 years of experience in the same field.

Leave a comment

Power Platform Academy

Start or Upgrade your Career with Power Platform

Learn with Akanksha

Python | Azure | AI/ML | OpenAI | MLOps

Design a site like this with WordPress.com
Get started