Fix bug with how we handle window size updates

This commit is contained in:
Jordan Eldredge 2022-03-06 21:24:10 -08:00
parent bed7a84cbd
commit 83c939dd07

View file

@ -51,12 +51,11 @@ export function useScreenSize() {
export function useWindowSize() {
const [size, setSize] = useState<Size>(Utils.getWindowSize());
const handler = useCallback(
const handler = useCallback(() => {
Utils.throttle(() => {
setSize(Utils.getWindowSize());
}, 100) as () => void,
[]
);
}, 100) as () => void;
}, []);
useEffect(() => {
window.addEventListener("resize", handler);
return () => {