inokawa / virtua

A zero-config, fast and small (~3kB) virtual list (and grid) component for React, Vue, Solid and Svelte.
https://inokawa.github.io/virtua/
MIT License
1.34k stars 47 forks source link

Consider supporting React Native #128

Open inokawa opened 1 year ago

inokawa commented 1 year ago

It may be possible if we detect element's resize with onLayout of View and get scroll position from ScrollView.

morajabi commented 1 year ago

what would be the difference with FlatList / SectionList / VirtualizedList?

inokawa commented 1 year ago

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.

morajabi commented 1 year ago

@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.

inokawa commented 1 year ago

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.

morajabi commented 1 year ago

@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.

inokawa commented 11 months ago

Probably there are no flushSync alternatives in react native. https://github.com/facebook/react-native/issues/41487

inokawa commented 1 week ago

React Native 0.76 supported useLayoutEffect. https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#uselayouteffect