S
S
Stepan2015-11-08 20:33:50
JavaScript
Stepan, 2015-11-08 20:33:50

How to pass element height in React?

There are several elements. parent, child. I need to calculate the height of the screen and learn about the height of the window, and set the corresponding height to other elements.
From the child, I send an action to the parent. There I take height in ComponentDidMount
And on this event I call action in the parent.
How to get the height of the parent. First, render works for me, then ComponentDidMount (you cannot set setState in it, eslint does not allow this) and then resize

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question