List of content you will read in this article:
- 1. β Why You Might Need to Know Your React Version?
- 2. π» How to Check Your React Version?
- 3. π§° How to Check React Version in Specific Frameworks?
- 4. π React Version Feature Map
- 5. π§ Common Issues & Troubleshooting
- 6. How to Update or Downgrade React Version?
- 7. πΊοΈ React Version Feature Breakdown
- 8. π Final Checklist
- 9. FAQ
ReactJS has become a top choice for modern frontend developers, but as the ecosystem evolves rapidly, it's essential to check your React version before adding new features, fixing bugs, or upgrading libraries. Whether you're maintaining a legacy project or kicking off something fresh with Create React App, Vite, or Next.js, understanding your current React setup is the first step to working smarter.
In this guide, you'll learn how to check React version, check version in package.json, use the React version command in the CLI, check React Native version, and more.
✅ Why You Might Need to Know Your React Version?
🔄 Version Compatibility
Not all third-party libraries or tools support every React version. Using outdated React might prevent you from leveraging modern UI frameworks, hooks, or features introduced in recent releases like Concurrent Mode or Server Components.
🚀 Migration Planning
Before upgrading your project, knowing the current version helps plan dependencies, read migration guides, and avoid compatibility issues.
🐛 Debugging Errors
Sometimes errors occur because your version of React lacks support for certain methods or hooks. Checking the version helps identify whether it’s a bug, a deprecated feature, or an unsupported API.
💻 How to Check Your React Version?
🔍 Method 1: Check React Version in package.json File
Your first stop should be the package.json file located in your project’s root directory. This file contains a list of dependencies including the installed React version.
📋 Steps:
- Open your React project folder.
- Open package.json using a code editor (like VSCode).
- Look under the dependencies section for react and react-dom.
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
...
}
The ^ symbol in ^18.2.0 means the version can be updated to any minor or patch version under 19.x.x.
🟢 Pro Tip: If you're planning to upgrade React, refer to the React changelog first to ensure you're aware of potential breaking changes.
💻 Method 2: Use React Version Command in CLI
One of the easiest and most accurate ways to check React version is using the command line.
📌 Commands to Use:
Open your terminal in your React project folder and run:
npm list react
Expected Output:
my-react-app@0.1.0 /Users/you/projects/my-react-app
└── react@18.2.0
To check the version of React DOM as well, use:
npm list react-dom
If you're using Yarn:
yarn list react
💡 Troubleshooting: If you receive an error like empty, you may not be in a valid React project folder or haven’t installed React yet.
🌐 Method 3: Using Browser Console or DevTools to Check React Version
If your React app is running in the browser, you can check the React version directly using Developer Tools.
👇 Steps:
- Open your application in the browser.
- Open DevTools (Right-click > Inspect or press Ctrl + Shift + I).
- Go to the Console tab.
- Type:
React.version
If React is exposed globally (which is often true in development mode), it will return something like:
"18.2.0"
🟢 Alternative:
If React DevTools is installed, it may also expose this variable through:
__REACT_DEVTOOLS_GLOBAL_HOOK__
This is useful if you’re debugging or need deeper inspection.
🧰 How to Check React Version in Specific Frameworks?
Different React-based setups might involve additional tools or wrappers like CRA, Next.js, Gatsby, or React Native. Here's how to check your version in each:
📦 Create React App (CRA)
Create React App typically manages the React version in package.json. You can also run:
npx create-react-app --version
However, for React-specific info, use:
npm list react
npm list react-dom
📱 Check React Native Version
React Native uses its own versioning and libraries. To check React Native version, you can run:
npm view react-native version
Or, for the version installed globally on your machine:
npm ls react-native -g
Expected Output:
/usr/local/lib
└── react-native@0.73.0
You can also check package.json:
"react-native": "0.73.0"
📌 Want more mobile-specific insights? Check out our guide on How to Check Angular Version — great for comparing multi-framework apps.
🌍 Next.js / Gatsby
For Next.js projects, the React version is still listed under package.json:
"react": "^18.2.0",
"next": "13.4.10"
To check via CLI:
npm list react
npm list next
Gatsby follows a similar pattern:
npm list react
npm list gatsby
🧠 Want to see how React compares to other top languages? Explore our 10 Best Programming Languages to Learn in 2025
📊 React Version Feature Map
React Version |
Major Features |
16.8 |
Hooks Introduced (useState, useEffect) |
17 |
Gradual Upgrade Support |
18 |
Automatic Batching, Concurrent Rendering |
18.3+ |
Server Components, Suspense Improvements |
This is useful when comparing your current setup with a project that uses more modern React functionality. For example, if your version is <16.8, you won't be able to use hooks like useState.
🚧 Common Issues & Troubleshooting
Even after learning how to check React version, you might face some errors when running commands or managing versions. Here’s how to troubleshoot the most common issues developers encounter.
❌ React Not Found
If running npm list react or npm view react version returns an empty output or a message like:
-- react@empty
or
npm ERR! missing: react@*, required by your-project@0.1.0
🔎 Possible Causes:
- You're not inside a valid React project folder.
- React hasn’t been installed yet.
- Your node_modules folder is missing or corrupted.
🛠️ Solutions:
Check if you’re in the right directory:pwd # On Mac/Linux
cd path/to/your/react-project
1. Install React and ReactDOM manually:
npm install react react-dom
2. If you use Yarn:
yarn add react react-dom
❌ Version Mismatch Between React and ReactDOM
React and ReactDOM should ideally be on the same version to avoid rendering or hydration issues, especially in projects using SSR (like Next.js) or strict mode.
📉 Symptoms:
- Runtime errors like Invariant Violation
- Hydration warnings in the browser
- Broken rendering or lifecycle behavior
🛠️ Fix:
Check both versions using:
npm list react
npm list react-dom
If they differ, align them by reinstalling:
npm install react@18.2.0 react-dom@18.2.0
🧠 Why It Matters:
ReactDOM handles the rendering process, so mismatched versions can cause unexpected UI behavior or development errors.
❌ CLI Commands Not Working or Hanging
Sometimes, commands like npm list, npm install, or npm start might fail or hang unexpectedly.
🔎 Common Reasons:
- Corrupted node_modules
- Outdated package-lock.json
- Version conflicts between packages
🛠️ Steps to Fix:
Delete node_modules and lock files:
rm -rf node_modules package-lock.json
1. Reinstall dependencies:
npm install
If using Yarn:
rm -rf node_modules yarn.lock
yarn install
Optional: Clear the npm cache to avoid using corrupt packages:npm cache clean --force
❓ Still Not Working?
Try creating a new React project using Create React App to test your Node/npm setup:npx create-react-app test-app
cd test-app
npm list react
If this works but your original project still fails, the issue may be specific to your project configuration or dependencies.
How to Update or Downgrade React Version?
Once you've learned how to check React version, the next step is knowing how to update it—especially if you're planning to use modern features or fix security vulnerabilities.
🆙 Upgrade React to the Latest Version
Use the npm install command to upgrade:
npm install react@latest react-dom@latest
Or if you use Yarn:
yarn add react@latest react-dom@latest
This will install the most recent stable versions. You can confirm the update with:
npm list react
npm list react-dom
⬇️ Downgrade to a Specific Version
Sometimes, certain dependencies require you to stick with an older version. You can downgrade React like this:
npm install react@16.14.0 react-dom@16.14.0
Then verify it in your package.json:
"dependencies": {
"react": "^16.14.0",
"react-dom": "^16.14.0"
}
🗺️ React Version Feature Breakdown
React has evolved significantly over the years. Here’s a handy table to understand what features you get with your version.
React Version |
Release Date |
Key Features |
16.8 |
Feb 2019 |
Introduced Hooks (useState, useEffect, useContext) |
17.0 |
Oct 2020 |
Gradual upgrade path, no new features, but major cleanup |
18.0 |
Mar 2022 |
Automatic Batching, useTransition, Concurrent Mode |
18.2 |
June 2022 |
Minor improvements, current stable version |
18.3+ (alpha) |
2024+ |
Server Components, streaming SSR, Suspense for data fetching |
Knowing this helps you avoid using unsupported features in your app and prevents migration surprises.
📋 Final Checklist
Before wrapping up, here's a summary of everything you can do:
- ✅ Use package.json to check version in package.json
- ✅ Use npm list react or yarn list react for CLI checks
- ✅ Use the browser console to view React.version
- ✅ Check React Native or Next.js versions with appropriate commands
- ✅ Troubleshoot version issues and plan upgrades safely
Knowing how to check React version ensures smoother upgrades, fewer bugs, and better compatibility with your dev stack. It’s a small step that pays off massively in the long run.
If you’re also working with Angular, don’t miss our detailed guide on How to check Angular version. Want to become a multi-framework expert? Start by exploring the 10 Best Programming Languages to Learn in 2025.
Need performance and stability for your React projects? Host your app on Linux VPS Hosting to scale fast and deploy globally.
People Are Also Reading: