benevbright/react-navigation-collapsible

Is there a way to use the useCollapsibleStack for Class components?

Closed this issue · 3 comments

I believe this library solves a huge problem in making the native experience even better by animating the header upon scrolling with FlatList. However, we also want to make the performance as optimal as possible especially when working with large FlatList with a lot of Functional Components on top of it.

The use of useCollapsibleStack hook out of the box is amazing and it gives us flexibility to customize our Components.

But since we have a big issue with the performance we decided to use Class base on every FlatList component instead of Functional Component to improve performances on every render of each component. We had tried using useCallBack for every callBack function passed in Child component however we're not satisfied with the results compared to Class base component.

Such as Avoid anonymous function on renderItem of FlatList
Here is one reason: https://stackoverflow.com/questions/45706257/react-native-onpress-extract-id-from-currenttarget

So it is great if this library can provide an API for useCollapsibleStack for Class

Why was this closed? Is there any update on this?

What if you just create your HOC function with the hooks function?
And using memo would make the same effect as React.PureComponent does.