Custom React hook that listens for changes in the viewport orientation.
const MyComponent = () => { useOnViewportOrientationChange(() => { console.log('Viewport orientation changed!'); }); return <div>Change the orientation of the viewport to see the effect!</div>;};
Custom React hook that listens for changes in the viewport orientation.
Example