From 94510dcbd9386c5a40495b8069c615ce4b80b4fc Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Mon, 20 Oct 2025 13:27:40 -0700 Subject: [PATCH] fix: add clearMarks and clearMeasures to performance global stub Summary: # Changelog: [Internal] React started using `clearMeasures` in https://github.com/facebook/react/pull/34803. It only does it if `performance.measure()` is defined. This should be enough for a feature check of User Timings API presence, but out stub doesn't follow the same spec. Adding `clearMarks()` and `clearMeasures()` stubs to the object. Differential Revision: D85082720 --- packages/react-native/Libraries/Core/setUpPerformance.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/Libraries/Core/setUpPerformance.js b/packages/react-native/Libraries/Core/setUpPerformance.js index 7aa5945d6f55..3f91689eabbf 100644 --- a/packages/react-native/Libraries/Core/setUpPerformance.js +++ b/packages/react-native/Libraries/Core/setUpPerformance.js @@ -20,7 +20,9 @@ if (NativePerformance) { // $FlowExpectedError[cannot-write] global.performance = { mark: () => {}, + clearMarks: () => {}, measure: () => {}, + clearMeasures: () => {}, now: () => { const performanceNow = global.nativePerformanceNow || Date.now; return performanceNow();