import { useEffect, useState } from 'react';
export const useResize = () => {
    const [width, setWidth] = useState(typeof window !== 'undefined' ? window.innerWidth : 0);
    useEffect(() => {
        const handleResize = () => setWidth(window.innerWidth);
        window.addEventListener('resize', handleResize);
        return () => window.removeEventListener('resize', handleResize);
    }, []);
    return width;
};
//# sourceMappingURL=useResize.js.map