Function useWindowSize

  • Get the width and height of the viewport

    Example

    const MyComponent = () => {
    const [width, height] = useWindowSize();
    return <div>Window is {width} by {height}</div>
    }

    Returns Dimensions

    Tuple with width and height integers

Generated using TypeDoc