marcocesarato / react-native-big-list

This is a high performance list view for React Native with support for complex layouts using a similar FlatList usage to make easy the replacement. This list implementation for big list rendering on React Native works with a recycler focused on performance and memory usage and so it permits processing thousands items on the list.
https://marcocesarato.github.io/react-native-big-list-docs/
Apache License 2.0
528 stars 42 forks source link

bug / contentContainerStyle is also affecting renderHeader #6

Open dougg0k opened 3 years ago

dougg0k commented 3 years ago

contentContainerStyle is also affecting renderHeader, would be the same thing as just wrapping BigList in a View. So, it's not working only in the content.

dougg0k commented 3 years ago

Would be too hard to give the lib consumer a prop so he would choose to make renderHeader a part or not, of the recycle list content? In my case the renderHeader is a bit heavier than normal, that could be the same situation for others.

In FlatList for example the only way is using their renderHeader alternative to have FlatList in a screen, otherwise would need to wrap all in a ScrollView, and that make FlatList pointless.

marcocesarato commented 3 years ago

contentContainerStyle is also affecting renderHeader, would be the same thing as just wrapping BigList in a View. So, it's not working only in the content.

Yes, it's normal isn't a bug. Anyway send your mockup about your expectation.

Would be too hard to give the lib consumer a prop so he would choose to make renderHeader a part or not, of the recycle list content? In my case the renderHeader is a bit heavier than normal, that could be the same situation for others.

In FlatList for example the only way is using their renderHeader alternative to have FlatList in a screen, otherwise would need to wrap all in a ScrollView, and that make FlatList pointless.

Maybe could be possibile only for Header and Footer. I need to try it and after I'll give you a feedback about it.

dougg0k commented 3 years ago

I mean, would be cool to have separate styling option as props, one for the renderHeader and another for the renderItem list which already is the contentContainerStyle. I think that's how FlatList work.

In FlatList contentContainerStyle does not affect header nor footer.

https://reactnative.dev/docs/flatlist#listheadercomponentstyle It also has a separate style obj for the footer. https://reactnative.dev/docs/flatlist#listfootercomponentstyle

marcocesarato commented 3 years ago

I mean, would be cool to have separate styling option as props, one for the renderHeader and another for the renderItem list which already is the contentContainerStyle. I think that's how FlatList work.

In FlatList contentContainerStyle does not affect header nor footer.

https://reactnative.dev/docs/flatlist#listheadercomponentstyle It also has a separate style obj for the footer. https://reactnative.dev/docs/flatlist#listfootercomponentstyle

I add a static header and footer, so they shouldn't be re-rendered. Released on 1.3.8.

About ListFooterComponentStyle and ListHeaderComponentStyle already exists if you use ListHeaderComponent or ListFooterComponent but they are not really needed because your children can be styled with flex: 1 to nullify the parent and the width and height can't be changed (for calculate the height of the view using processor) and they are available only for compatibility. columnWrapperStyle can be implemented but, as for ListFooterComponentStyle, I must to overwrite height and width so its only for compatibility.

dougg0k commented 3 years ago

Nice, thanks.