/** * 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. * * @flow strict-local * @format */ import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; import type Performance from 'react-native/src/private/webapis/performance/Performance'; import RNTesterText from '../../components/RNTesterText'; import * as React from 'react'; import {useEffect} from 'react'; import {Button, StyleSheet, View} from 'react-native'; declare var performance: Performance; const {useState, useCallback} = React; 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 (