📄 primereact/hooks/useresizelistener

File: useresizelistener.md | Updated: 11/15/2025

Source: https://primereact.org/hooks/useresizelistener/

Introducing PrimeReact v11 Alpha 🥁Learn More

useResizeListener

Tracks window resize event.

Import#


import { useResizeListener } from 'primereact/hooks';
         

Copy

Basic#


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

Width: 1280Height: 800

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

Copy

  • Import

  • Basic

PrimeReact 10.9.7 by PrimeTek