Answer the question
In order to leave comments, you need to log in
How to calculate block height before rendering in react?
Hello, I need to get the height of the accordion before rendering itself, I use the styled-components library and react-transition-group. The problem is in the initial animation, because it needs a block height.
I would be grateful for the help
Link
Answer the question
In order to leave comments, you need to log in
Well, jquery somehow copes with bootstrap (they hardcode the height of the content, having never rendered it yet), but there is some kind of black magic.
I can suggest to the author to overflow: hidden the container in which the content is nested: in this case, the content will be rendered, but it will not be visible.
Plus, attach a handler to
resizing the window: open the accordion at some one window width, then make it narrower and your code does like this
: vlom clone and build also threw the build on pages
Although some delay, after which the increase in the height of the content begins when the page narrows, confuses me. but to me, to be honest, it's hard to look for a reason.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question