Within my project, I have connected the react-static repository with the react repository using yarn link.
"react": "^16.13.1"
"react-static": "^6.0.18"
I am importing various components from the react-static repository to use in the react repository. My goal is to utilize vw/vh units in the react-static components so that they appear as described below in the react project.
The challenge lies in making a div occupy 100% width and 100% height of the viewport for its children elements. I aim to achieve this in the following manner:
<div className="wrapper">
<div className="inner"></div>
</div>
The inner div (imported from react-static) should have width: 100vw; height: 100vh;
. For instance - if I specify the wrapper size (react container) as width: 400px; height: 200px;
(while the window size is 1920x1080), I expect the inner container's viewport to adjust accordingly to match the wrapper size - resulting in width: 400px; height: 400px;
while still behaving as if the wrapper encompasses the entire window for it.
Thus far, the only solution I have come across involves manually calculating sizes for elements within the inner container. Do you have any suggestions?