nkbt / react-collapse

Component-wrapper for collapse animation with react-motion for elements with variable (and dynamic) height
MIT License
1.13k stars 113 forks source link

initialStyle not working #291

Open Jacint-Magyar opened 3 years ago

Jacint-Magyar commented 3 years ago

initialStyle prop not applied on Collapse. I want to set initial height instead of the default 0, when it's NOT open. So it would appear partially open. I assumed initialStyle is for this use case as it would be very useful.

nkbt commented 3 years ago

It is not really necessary. Just do not ever close Collapse. Keep it open and just change your content height. Collapse will smoothly follow

nkbt commented 3 years ago

InitialStyle is not what you think it is.

See notes:

initially opened Collapse elements will be statically rendered with no animation. You can override this behaviour by using initialStyle prop

Jacint-Magyar commented 3 years ago

Thank you. It works if i keep it open and only change height.