In my project I have react-static repository linked (with yarn link) with react repo.
"react": "^16.13.1"
"react-static": "^6.0.18"
From react-static repository I am importing multiple components which are used in react repo. I want to be able to use vw/vh units in react-static, so that they will display in react project in the way I described below.
The problem is how to make the div to be 100% width and 100% height of viewport for the children. I need to make things work this way:
<div className="wrapper">
<div className="inner"></div>
</div>
The inner div (imported from react-static) needs to have width: 100vw; height: 100vh;
. For example - if I set the wrapper size (react container) for width: 400px; height: 200px;
(with window size 1920x1080) I want the inner container's viewport to change the way it will match wrapper size - so it will have width: 400px; height: 400px;
but will behave like the wrapper is the whole window for it.
The only solution I found so far is to calculate size for the elements in the inner container. Any suggestions?