Open huygn opened 6 years ago
window.innerHeight is your best bet.
window.innerHeight
Below method work on both android/chrome and ios/safari. One caveat is that you will see a flash from 100vh to window.innerHeight (at least on https://dautu.io) because the initial html is static-generated, and window is only avaible on client side.
100vh
window
componentDidMount() { this.container.style.minHeight = `${window.innerHeight}px` } <div ref={this.setRef} className="min-h-screen">...</div>
window.innerHeight
is your best bet.Below method work on both android/chrome and ios/safari. One caveat is that you will see a flash from
100vh
towindow.innerHeight
(at least on https://dautu.io) because the initial html is static-generated, andwindow
is only avaible on client side.