TypeError: global.performance.now is not a function in react native

Viewed 5727

error


Unable to find any solution to this query.

TypeError: global.performance.now is not a function
at node_modules/expo/build/logs/LogSerialization.js:156:14 in _captureConsoleStackTrace
at node_modules/expo/build/logs/LogSerialization.js:41:26 in serializeLogDataAsync
- ... 9 more stack frames from framework internals


3 Answers

make change to this file: node_modules/react-native-reanimated/src/reanimated2/core.ts Line 386, remove this:

global.performance = {
 now: global._chronoNow,

};

then add this:

if(global.performance == null) {
    global.performance = {
      now: global._chronoNow,
    };
  }

If you are using the expo application, then try reinstalling the latest expo application or connect the device to the computer and run the expo start command, then hit (a or i) to automatically install the compatible version on your devices.

Related