nkbt/react-collapse

Why there is delay when opening the collapse ?

Closed this issue · 6 comments

kopax commented

I am comparing react-collapse with bootstrap 4 and it's navbar collapse menu.

Why is the bootstrap 4 effect more fluid and is it possible to have the same ?

nkbt commented

Because it uses Spring animation. See https://github.com/chenglou/react-motion for details

kopax commented

I have read the doc, is it possible for you to share the details ?

Also, when I click on the checkbox here it's perfectly fluid!

nkbt commented

So if http://nkbt.github.io/react-collapse/example/ is good, then delay in your app is something about your app, I reckon...

kopax commented

Where can I find the example source code?

kopax commented

I have remove a component with a Hudge jsx content under my test and then it went fluid again.
I guess I should move the effect to it's own component so it doesn't rerender the whole thing.

nkbt commented

yep, pretty usual problem when using react-motion. Need a proper sub-components caching with shouldComponentUpdate