Open delphinebugner opened 6 months ago
Here's the full error message:
Type '{ onViewableItemsChanged: (info: { viewableItems: ViewToken[]; changed: ViewToken[]; }) => void; viewabilityConfig: ViewabilityConfig; }' is not assignable to type 'ViewabilityConfigCallbackPair'.
Types of property 'onViewableItemsChanged' are incompatible.
Type '(info: { viewableItems: import("../node_modules/@shopify/flash-list/dist/viewability/ViewToken").default[]; changed: import("../node_modules/@shopify/flash-list/dist/viewability/ViewToken").default[]; }) => void' is not assignable to type '(info: { viewableItems: import("../node_modules/@react-native/virtualized-lists/Lists/VirtualizedList").ViewToken[]; changed: import("../node_modules/@react-native/virtualized-lists/Lists/VirtualizedList").ViewT...'.
Types of parameters 'info' and 'info' are incompatible.
Type '{ viewableItems: import("../node_modules/@react-native/virtualized-lists/Lists/VirtualizedList").ViewToken[]; changed: import("../node_modules/@react-native/virtualized-lists/Lists/VirtualizedList").ViewToken[]; }' is not assignable to type '{ viewableItems: import("../node_modules/@shopify/flash-list/dist/viewability/ViewToken").default[]; changed: import("../node_modules/@shopify/flash-list/dist/viewability/ViewToken").default[]; }'.
Types of property 'viewableItems' are incompatible.
Type 'import("../node_modules/@react-native/virtualized-lists/Lists/VirtualizedList").ViewToken[]' is not assignable to type 'import("../node_modules/@shopify/flash-list/dist/viewability/ViewToken").default[]'.
Property 'timestamp' is missing in type 'import("../node_modules/@react-native/virtualized-lists/Lists/VirtualizedList").ViewToken' but required in type 'import("../node_modules/@shopify/flash-list/dist/viewability/ViewToken").default'.ts(2322)
ViewToken.d.ts(6, 5): 'timestamp' is declared here.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@shopify/flash-list@1.6.3
for the project I'm working on.There's a typing issue with the
viewabilityConfigCallbackPairs
props: its uses the react-native typing, which uses theonViewableItemsChanged
typing, which uses ViewToken without timestamp in it 😢I made a quick patch that solved my problem, copy-pasted from the RN repo!
Might do a PR later! With factorizing the
onViewableItemsChanged
type maybe? always taking the shopifyViewToken
!This issue body was partially generated by patch-package.