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

Avoid rendering content when collapsed #28

Open
ykadosh opened this issue Apr 26, 2021 · 0 comments
Open

Avoid rendering content when collapsed #28

ykadosh opened this issue Apr 26, 2021 · 0 comments

Comments

@ykadosh
Copy link
Collaborator

ykadosh commented Apr 26, 2021

Currently, the Collapsible component renders its content regardless of whether it's expanded or not.
It does so in order to be able to calculate the height to which it needs to expand.

This can lead to performance issues when you have many Collapsible elements on the screen.
And even for a single item, it's redundant to render what the user doesn't see.

The solution is to not render the content when expanded is false, but when it's changing to true, render it collapsed, capture the height, and then expand.

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

No branches or pull requests

1 participant