RSSAmplifier

Jon Kuperman · Feb 22, 2021

Get React Version

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

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 )…

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

Read on jonkuperman.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.