Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug / contentContainerStyle is also affecting renderHeader #6

Closed
dougg0k opened this issue Jun 12, 2021 · 5 comments
Closed

bug / contentContainerStyle is also affecting renderHeader #6

dougg0k opened this issue Jun 12, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@dougg0k
Copy link

dougg0k commented Jun 12, 2021

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 dougg0k changed the title contentContainerStyle is also affecting renderHeader bug/contentContainerStyle is also affecting renderHeader Jun 12, 2021
@dougg0k dougg0k changed the title bug/contentContainerStyle is also affecting renderHeader bug / contentContainerStyle is also affecting renderHeader Jun 12, 2021
@dougg0k
Copy link
Author

dougg0k commented Jun 12, 2021

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
Copy link
Owner

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
Copy link
Author

dougg0k commented Jun 15, 2021

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 marcocesarato added the enhancement New feature or request label Jun 15, 2021
marcocesarato added a commit that referenced this issue Jun 16, 2021
@marcocesarato
Copy link
Owner

marcocesarato commented Jun 16, 2021

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.

marcocesarato added a commit that referenced this issue Jun 16, 2021
@dougg0k
Copy link
Author

dougg0k commented Sep 3, 2021

Nice, thanks.

@dougg0k dougg0k closed this as completed Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants