/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow strict-local * @oncall react_native */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; import type MemoryInfo from 'react-native/src/private/webapis/performance/MemoryInfo'; import type ReactNativeStartupTiming from 'react-native/src/private/webapis/performance/ReactNativeStartupTiming'; import RNTesterText from '../../components/RNTesterText'; import * as React from 'react'; import {useEffect} from 'react'; import {Button, StyleSheet, View} from 'react-native'; import Performance from 'react-native/src/private/webapis/performance/Performance'; import { type PerformanceEntry, type PerformanceEventTiming, PerformanceObserver, } from 'react-native/src/private/webapis/performance/PerformanceObserver'; const {useState, useCallback} = React; const performance = new Performance(); function MemoryExample(): React.Node { // Memory API testing const [memoryInfo, setMemoryInfo] = useState(null); const onGetMemoryInfo = useCallback(() => { // performance.memory is not included in bom.js yet. // Once we release the change in flow this can be removed. setMemoryInfo(performance.memory); }, []); return (