Search code examples
react-nativepackageimporterror

React native react-addons-perf Import Problem


I want to log the run times of functions in the react native project. so I want to use the "react-addons-perf" library. However, I get this error when I try to integrate.

error: bundling failed: Error: Unable to resolve module react-addons-perf from /Users/XXX/settingsScreen.tsx: Module react-addons-perf does not exist in the Haste module map

yarn add @types/react-addons-perf (Using typescript)

import Perf from 'react-addons-perf'; doesnt't work

import Perf from "ReactPerf"; also doesn't work

I'm open to suggestions for solutions or an alternative library.

React native version: react-native@^0.59.9:


Solution

  • As of React 16, react-addons-perf is not supported. Please use your browser’s profiling tools to get insight into which components re-render.