Open inokawa opened 1 year ago
what would be the difference with FlatList / SectionList / VirtualizedList?
Yes, I know there have been already FlatList and VirtualizedList (and also FlashList).
I'm not sure it's worth doing. If we were to make it, the RN version would work without configuration of height/width like web version. And it should support bi-directional infinite scrolling like Twitter App in the future.
@inokawa Update: we used FlashList in iOS expo app. In my experience it's focused on recycling views and it fails to accommodate certain use-cases very well (eg. reverse scrolling with sticky items). So it's not a one-size-fits-all solution and there is room for another library.
Thank you for sharing the information! Although React Native is a bit de-prioritized than something for web to me, it will be worth trying it.
@inokawa Same. Althought RN lists can be better, virtua can provide the most value in web given the lack modern, up-to-date and light weight solutions.
Probably there are no flushSync alternatives in react native. https://github.com/facebook/react-native/issues/41487
React Native 0.76 supported useLayoutEffect. https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#uselayouteffect
It may be possible if we detect element's resize with onLayout of View and get scroll position from ScrollView.