This is a 1 min read ยท Published on 22 Feb 2021

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

Subscribe to my email list!

Let me be real with you. Sometimes when I'm bored I log in to Buttondown and look at the audience number. If it's bigger than it was the week before, well that makes me feel really happy! I promise I'll never spam you and I will, at most, send you a monthly update with what's happening on this site.