Get React Version
Looking to get react version from one of your apps? You have a few different options!
Get React Version in code
If you’re already in the JavaScript, you can print the current React version by doing:
import React, { version } from 'react';
console.log(version);
This also works with the require syntax:
const React = require('react');
const version = React.version;
console.log(version);
You can also check your package-lock.json
or yarn.lock
file!
cat package-lock.json | grep \"react\" -A 1
Or, if you are using Yarn:
cat yarn.lock | grep \"react\" -A 1
Written by Jon Kuperman living in Florida working on Adobe's Creative Cloud. You should follow him on Twitter