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

renderSectionHeader doubles up on styles #362

Open
PiTiLeZarD opened this issue Dec 19, 2023 · 1 comment
Open

renderSectionHeader doubles up on styles #362

PiTiLeZarD opened this issue Dec 19, 2023 · 1 comment

Comments

@PiTiLeZarD
Copy link

Hey all. First, thanks for this lib, filtering 6k rows with RN section list was impossibly slow and now it's usable ;)

I'm using the sections version of BigList and for some reason, my styles are being doubled:

            renderSectionHeader={(section) => (
                <View
                    style={{
                        paddingHorizontal: 5,
                        paddingVertical: 3,
                        display: "flex",
                        alignItems: "center",
                        borderStyle: "solid",
                        borderColor: "black",
                        borderTopWidth: 1,
                        borderBottomWidth: 1,
                        backgroundColor: "white",
                    }}
                >
                    <Typography>{sections[section][0].date.toFormat("dd/MM/yyyy")}</Typography>
                </View>
            )}

This renders like that:
image

I dug around a little and I can't figure out why. The same styles were applied in ReactNative SectionList headers and was working fine.

Also side question: any way to have the main header sticky instead of each sections?

Cheers

@PiTiLeZarD
Copy link
Author

Not entirely sure but it might be due to this: https://github.com/marcocesarato/react-native-big-list/blob/master/lib/BigListSection.jsx#L55 picking the style from the child, and still using the child as is. It works if I wrap my header in a View without styles, not ideal but it'll do for now ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant