From 2b10180d74b9ab18dc789824f1ab8251cc918ae5 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 27 Aug 2025 21:15:58 -0500 Subject: [PATCH] Update Storybook ListContained to use new List --- src/view/screens/Storybook/ListContained.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/view/screens/Storybook/ListContained.tsx b/src/view/screens/Storybook/ListContained.tsx index 3804c1a6b0..e7ee7f6e0b 100644 --- a/src/view/screens/Storybook/ListContained.tsx +++ b/src/view/screens/Storybook/ListContained.tsx @@ -1,19 +1,18 @@ import React from 'react' -import {View} from 'react-native' +import {type FlatList, View} from 'react-native' -import {ScrollProvider} from '#/lib/ScrollContext' -import {List, type ListMethods} from '#/view/com/util/List' import {Button, ButtonText} from '#/components/Button' import * as Toggle from '#/components/forms/Toggle' +import {List, ListScrollProvider} from '#/components/List' import {Text} from '#/components/Typography' export function ListContained() { const [animated, setAnimated] = React.useState(false) - const ref = React.useRef(null) + const ref = React.useRef(null) const data = React.useMemo(() => { return Array.from({length: 100}, (_, i) => ({ - id: i, + key: i + '', text: `Message ${i}`, })) }, []) @@ -21,7 +20,7 @@ export function ListContained() { return ( <> - { 'worklet' console.log( @@ -33,6 +32,7 @@ export function ListContained() { ) }}> { return ( @@ -46,8 +46,8 @@ export function ListContained() { ) }} - keyExtractor={item => item.id.toString()} - disableFullWindowScroll={true} + keyExtractor={item => item.key.toString()} + // disableFullWindowScroll={true} style={{flex: 1}} onStartReached={() => { console.log('Start Reached') @@ -56,10 +56,9 @@ export function ListContained() { console.log('End Reached (threshold of 2)') }} onEndReachedThreshold={2} - ref={ref} disableVirtualization={true} /> - +