Function useOnViewportOritentationChange

  • Custom React hook that listens for changes in the viewport orientation.

    Example

    const MyComponent = () => {
    useOnViewportOrientationChange(() => {
    console.log('Viewport orientation changed!');
    });

    return <div>Change the orientation of the viewport to see the effect!</div>;
    };

    Parameters

    • effectProp: (() => void)
        • (): void
        • Returns void

    Returns void