diff --git a/packages/example/src/modules/program/view/ProgramList.tsx b/packages/example/src/modules/program/view/ProgramList.tsx index d52b8b5f..c900034e 100644 --- a/packages/example/src/modules/program/view/ProgramList.tsx +++ b/packages/example/src/modules/program/view/ProgramList.tsx @@ -28,6 +28,7 @@ type ProgramListProps = { containerStyle?: object; listRef?: MutableRefObject; data?: ProgramInfo[]; + listSize?: number; variant?: 'normal' | 'variable-size'; }; @@ -41,6 +42,7 @@ export const ProgramList = ({ listRef, data, variant = 'normal', + listSize = 1000, }: ProgramListProps) => { const navigation = useNavigation>(); const theme = useTheme(); @@ -57,10 +59,7 @@ export const ProgramList = ({ [navigation, variant], ); - const programInfos = useMemo( - () => data ?? getPrograms(variant === 'variable-size' ? 10 : 1000), - [data, variant], - ); + const programInfos = useMemo(() => data ?? getPrograms(listSize), [data, listSize]); const itemSize = useMemo( () => { @@ -104,10 +103,12 @@ export const ProgramsRow = ({ containerStyle, listRef, variant = 'normal', + listSize, }: { containerStyle?: object; listRef?: MutableRefObject; variant?: 'normal' | 'variable-size'; + listSize?: number; }) => { const theme = useTheme(); return ( @@ -118,6 +119,7 @@ export const ProgramsRow = ({ }} listRef={listRef} variant={variant} + listSize={listSize} /> ); }; diff --git a/packages/example/src/modules/program/view/ProgramListWithTitle.tsx b/packages/example/src/modules/program/view/ProgramListWithTitle.tsx index ee016bca..4eca6db0 100644 --- a/packages/example/src/modules/program/view/ProgramListWithTitle.tsx +++ b/packages/example/src/modules/program/view/ProgramListWithTitle.tsx @@ -8,28 +8,29 @@ import { SpatialNavigationVirtualizedListRef } from '../../../../../lib/src/spat type Props = { title: string; listRef?: MutableRefObject; + listSize?: number; }; -export const ProgramListWithTitle = ({ title, listRef }: Props) => { +export const ProgramListWithTitle = ({ title, listRef, listSize }: Props) => { return ( {title} - + ); }; -export const ProgramListWithTitleAndVariableSizes = ({ title }: Props) => { +export const ProgramListWithTitleAndVariableSizes = ({ title, listSize }: Props) => { return ( {title} - + ); }; diff --git a/packages/example/src/pages/Home.tsx b/packages/example/src/pages/Home.tsx index c5e4bb00..26263341 100644 --- a/packages/example/src/pages/Home.tsx +++ b/packages/example/src/pages/Home.tsx @@ -35,9 +35,15 @@ export const Home = () => { - + - +