From c357cb4bbfbdb5aba8b2550487e3b2d174614834 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Thu, 18 Mar 2021 11:33:32 -0700 Subject: [PATCH] Viewability examples Summary: # Changelog: [Internal][Added] - Provide more props to SectionList examples Reviewed By: kacieb Differential Revision: D27100891 fbshipit-source-id: 10e83ca16badf18e8218557aff1ee8a7a86e8c54 --- .../examples/SectionList/SectionListExamples.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/rn-tester/js/examples/SectionList/SectionListExamples.js b/packages/rn-tester/js/examples/SectionList/SectionListExamples.js index b81cf9674af..ce5c0f4e78e 100644 --- a/packages/rn-tester/js/examples/SectionList/SectionListExamples.js +++ b/packages/rn-tester/js/examples/SectionList/SectionListExamples.js @@ -224,8 +224,10 @@ export function SectionList_withSeparators(): React.Node { export function SectionList_onViewableItemsChanged(props: { viewabilityConfig: ViewabilityConfig, + offScreen?: ?boolean, + horizontal?: ?boolean, }): React.Node { - const {viewabilityConfig} = props; + const {viewabilityConfig, offScreen, horizontal} = props; const [output, setOutput] = React.useState(''); const exampleProps = { onViewableItemsChanged: info => @@ -236,13 +238,15 @@ export function SectionList_onViewableItemsChanged(props: { .join(', '), ), viewabilityConfig, + horizontal, }; return ( + testOutput={output}> + {offScreen === true ? : null} + ); } @@ -251,6 +255,7 @@ type Props = { onTest?: ?() => void, testLabel?: ?string, testOutput?: ?string, + children?: ?React.Node, }; const SectionListExampleWithForwardedRef = React.forwardRef( @@ -274,6 +279,7 @@ const SectionListExampleWithForwardedRef = React.forwardRef( ) : null} ) : null} + {props.children}