Skip to content

Commit

Permalink
Stub more methods of performance API (#44583)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #44583

This native module is only available in the new architecture, stub the methods elsewhere.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D57382785

fbshipit-source-id: f6c988bcfd12633697b45a1f862b2cd4fb5d00d4
  • Loading branch information
javache authored and facebook-github-bot committed May 16, 2024
1 parent 1677521 commit 0bf8c6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react-native/Libraries/Core/setUpPerformance.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ if (NativePerformance) {
} else {
if (!global.performance) {
// $FlowExpectedError[cannot-write]
global.performance = ({
now: function () {
global.performance = {
mark: () => {},
measure: () => {},
now: () => {
const performanceNow = global.nativePerformanceNow || Date.now;
return performanceNow();
},
}: {now?: () => number});
};
}
}

0 comments on commit 0bf8c6e

Please sign in to comment.