How can one tell the version of React running at runtime in the browser?


Is there a way to know the runtime version of React in the browser?

This question is tagged with javascript reactjs

~ Asked on 2016-05-03 02:22:28

The Best Answer is


React.version is what you are looking for.

It is undocumented though (as far as I know) so it may not be a stable feature (i.e. though unlikely, it may disappear or change in future releases).

Example with React imported as a script

const REACT_VERSION = React.version;

  <div>React version: {REACT_VERSION}</div>,
<script src=""></script>
<script src=""></script>

<div id="root"></div>

Example with React imported as a module

import React from 'react';


Obviously, if you import React as a module, it won't be in the global scope. The above code is intended to be bundled with the rest of your app, e.g. using webpack. It will virtually never work if used in a browser's console (it is using bare imports).

This second approach is the recommended one. Most websites will use it. create-react-app does this (it's using webpack behind the scene). In this case, React is encapsulated and is generally not accessible at all outside the bundle (e.g. in a browser's console).

~ Answered on 2016-05-03 02:25:45


From the command line:

npm view react version
npm view react-native version

~ Answered on 2019-11-15 14:53:52

Most Viewed Questions: