useResizeListener

Tracks window resize event.


import { useResizeListener } from 'primereact/hooks';
         

Resize the browser window to view information about the resize event.

Width: 0Height: 0

const [bindWindowResizeListener, unbindWindowResizeListener] = useResizeListener({
    listener: (event) => {
        setEventData({
            width: event.currentTarget.innerWidth,
            height: event.currentTarget.innerHeight,
        })
    }
});