This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { useWindowSize } from 'react-use'; | |
// 100vh is broken on mobile (Chrome, Safari): | |
// https://chanind.github.io/javascript/2019/09/28/avoid-100vh-on-mobile-web.html | |
export default function use100vh() { | |
const ref = React.useRef(); | |
const { height } = useWindowSize(); |