diff --git a/packages/rn-tester/js/examples/FlatList/FlatListExamples.js b/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js similarity index 77% rename from packages/rn-tester/js/examples/FlatList/FlatListExamples.js rename to packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js index dd7aff73022..92c97fd49f1 100644 --- a/packages/rn-tester/js/examples/FlatList/FlatListExamples.js +++ b/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js @@ -96,7 +96,7 @@ export function FlatList_inverted(): React.Node { }; return ( - Menu - ); } -export function FlatList_onEndReached(): React.Node { - const [output, setOutput] = React.useState(''); - const exampleProps = { - onEndReached: info => setOutput('onEndReached'), - onEndReachedThreshold: 0, - }; - const ref = React.useRef(null); - - const onTest = () => { - const scrollResponder = ref?.current?.getScrollResponder(); - if (scrollResponder != null) { - scrollResponder.scrollToEnd(); - } - }; - - return ( - - ); -} export function FlatList_withSeparators(): React.Node { const exampleProps = { @@ -179,9 +155,7 @@ export function FlatList_withSeparators(): React.Node { }; const ref = React.useRef(null); - return ( - - ); + return ; } export function FlatList_onViewableItemsChanged(props: { @@ -217,13 +191,13 @@ export function FlatList_onViewableItemsChanged(props: { : null; return ( - {offScreen === true ? : null} - + ); } @@ -235,38 +209,41 @@ type Props = { children?: ?React.Node, }; -const FlatListExampleWithForwardedRef = React.forwardRef( - (props: Props, ref) => { - return ( - - {props.testOutput != null ? ( - - - {props.testOutput} - - {props.onTest != null ? ( -