nkbt/react-collapse

currentStyle is at 0 when I change route, and come back to it

Closed this issue · 2 comments

Hello there!

Thank you for such a great plugin!

When I change route (using react router) ~
The collapse component seem to go back to height: 0

I use the forceInitialAnimation={false} property so that it keeps its height
And I don't know why... would you have an idea ?

example

I found the solution, I need to make sure that my component render only if it's children has a lenght greater than 0. Or else, it will try to render the component, but without elements. Which makes it go from 0 to its maximal height

It can be closed! Sorry about the trouble!