/** * 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 */ import {RNTesterThemeContext} from '../../components/RNTesterTheme'; import * as React from 'react'; import { type ElementRef, useContext, useLayoutEffect, useRef, useState, } from 'react'; import {Button, ScrollView, StyleSheet, Text, View} from 'react-native'; export const name = 'IntersectionObserver MDN Example'; export const title = name; export const description = 'Copy of the example in MDN about IntersectionObserver with different thresholds.'; export function render(): React.Node { return ; } /** * Similar to the example in MDN: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API */ function IntersectionObserverMDNExample(): React.Node { const theme = useContext(RNTesterThemeContext); const [showMargin, setShowMargin] = useState(true); return (