GetStream / react-native-bidirectional-infinite-scroll

📜 React Native - Bidirectional Infinite Smooth Scroll
https://getstream.github.io/react-native-bidirectional-infinite-scroll/
MIT License
236 stars 27 forks source link

Get `ref` not exist error in typescript #23

Open hanayashiki opened 2 years ago

hanayashiki commented 2 years ago

Try to do this:

            <FlatList
                ref={(list) => flatListRef.current = list}
            />
        );

but get:

Type '{ ref: (list: any) => any; data: Page[]; renderItem: ({ item: page }: ListRenderItemInfo<Page>) => Element; onStartReached: () => Promise<void>; onEndReached: () => Promise<...>; keyExtractor: (page: Page) => string; extraData: number; }' is not assignable to type 'IntrinsicAttributes & Omit<FlatListProps<Page>, "maintainVisibleContentPosition"> & { onEndReached: () => Promise<void>; ... 10 more ...; ListFooterComponent?: ComponentType<...>; }'.
  Property 'ref' does not exist on type 'IntrinsicAttributes & Omit<FlatListProps<Page>, "maintainVisibleContentPosition"> & { onEndReached: () => Promise<void>; ... 10 more ...; ListFooterComponent?: ComponentType<...>; }'.ts(2322)

Versions

├─ @stream-io/flat-list-mvcp@0.10.1
└─ react-native-bidirectional-infinite-scroll@0.3.3