From fa47c27eae3dd2dbf5fab8278960e22577e0c803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 2 Apr 2024 06:27:05 -0700 Subject: [PATCH] Support dark theme in PerformanceApiExample in RNTester (#43705) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43705 Changelog: [internal] Reviewed By: rshest Differential Revision: D55477744 fbshipit-source-id: 6960366330343678e493dd54292bda7df5a61e6a --- .../Performance/PerformanceApiExample.js | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js b/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js index 08a1629fe19..60b27444e79 100644 --- a/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js +++ b/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js @@ -14,7 +14,9 @@ import type MemoryInfo from 'react-native/src/private/webapis/performance/Memory import type ReactNativeStartupTiming from 'react-native/src/private/webapis/performance/ReactNativeStartupTiming'; import RNTesterPage from '../../components/RNTesterPage'; +import {RNTesterThemeContext} from '../../components/RNTesterTheme'; import * as React from 'react'; +import {useContext} from 'react'; import {Button, StyleSheet, Text, View} from 'react-native'; import Performance from 'react-native/src/private/webapis/performance/Performance'; @@ -22,6 +24,8 @@ const {useState, useCallback} = React; const performance = new Performance(); function MemoryExample(): React.Node { + const theme = useContext(RNTesterThemeContext); + // Memory API testing const [memoryInfo, setMemoryInfo] = useState(null); const onGetMemoryInfo = useCallback(() => { @@ -34,13 +38,13 @@ function MemoryExample(): React.Node {