• Custom React hook that listens for viewport resize events. The effect callback is called both on mount and resize.

    Example

    const MyComponent = () => {
    useOnResize(() => {
    console.log('Viewport resized!');
    }, []);

    return <div>Resize the viewport to see the effect!</div>;
    };

    Parameters

    Returns void