I like to make a div
expand according to its content height but the hole Component
inside that div
is hidden if I use like height: '100%'
. It's a bit complex and wish for some extra eyes!
I made a CodeSandbox
Looks like this in Chrome:
I can see during debug that the "hidden" Component
is rendering ok so it's strange that it's "hidden"
If I set the same Style
to height: 1000
the <ul>
have Children:
But I want it to expand according to its content height so height: 1000
will not work.
In this CodeSandbox I set the height: 1000,
to demonstrate what happens. The Component
that refuse to expand height is a Masonry
image gallery Component
style={{
width,
height: 1000,
position: 'relative',
margin: '0 auto',
}}
When you open the Sandbox you see in the left editor windows this TimeLineViewer.js
and the Style
code problem. The TimeLineViewer.js
loads the Masonry
image gallery Component
Masonry.js
What I have tried is to set parent to also 100% height but with no luck.. I'm a little bit new to JavaScript and HTML so advice would be good