st0ffern / react-native-optimized-flatlist

Optimization for complex and slow React Native FlatLists
MIT License
259 stars 47 forks source link

Access FlatList methods #6

Open danielreuterwall opened 7 years ago

danielreuterwall commented 7 years ago

Hey,

I've experienced a great performance boots and improved stability on Android using the OptimizedFlatList, on iOS thought FlatList works perfectly.

One limitation of the OptimizedFlatList though is access to methods on the underlying FlatList, in my case I need to access scrollToOffset. The ref to the OptimizedFlatList doesn't expose the methods of the FlatList.

Would be great to have to be able to use it as a true drop-in replacement/optimization of the FlatList.

danielreuterwall commented 7 years ago

I've exposed scrollToOffset in a fork and it works fine. Should we expose all methods from FlatList just like FlatList exposes most of them from VirtualizedList? Not sure if some of them might be unavailable due to the optimization. What do you say @stoffern? I could make a PR.

st0ffern commented 6 years ago

@danielreuterwall great to hear that you are experiencing better performance, as this is the meaning 😉 access to functions should not be a problem, the optimization should still work fine.

Please make a PR when you have the time 😉