Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found: Can't resolve 'react-dom/lib/ReactPerf' in '\node_modules\react-addons-perf'

I am using React and ReactDOM of version 16.0.0 and react-addons-perf 15.4.2 that is latest version. But i am gating this compile time error.

./node_modules/react-addons-perf/index.js Module not found: Can't resolve 'react-dom/lib/ReactPerf' in '....\node_modules\react-addons-perf'

like image 495
shyam Avatar asked Oct 05 '17 04:10

shyam


People also ask

How to fix Module not found error Can t resolve react dom client?

To solve the error "Module not found: Error: Can't resolve 'react-dom'", make sure to install the react-dom package by opening your terminal in your project's root directory and running the command npm install react-dom react and restart your development server. Copied!

Can t resolve react in Module?

To solve the "Module not found: Can't resolve" error in React, make sure to install the package from the error message if it's a third-party package, e.g. npm i somePackage . If you got the error when importing local files, correct your import path.

How do I import createRoot into react?

import React from 'react'; import ReactDOM from 'react-dom'; import { createRoot } from 'react-dom/client'; import Switch from './components/Switch'; const root = ReactDOM. createRoot(document. getElementById('root')); root. render( <React.

How do I check react version?

To check which React version is your project using you need to open the package. json. Take a look under the dependencies section. It should list all of the dependencies of your project and one of those should be React.


1 Answers

To follow up on what Rei Dien said, the React 16 announcement mentions the following:

react-addons-perf no longer works at all in React 16. It’s likely that we’ll release a new version of this tool in the future. In the meantime, you can use your browser’s performance tools to profile React components.

To put it simply, just npm uninstall react-addons-perf and everything should be fine.

like image 179
223seneca Avatar answered Sep 19 '22 17:09

223seneca