feat: remove useWideFormat

This commit is contained in:
TrèsAbhi committed 2024-07-09 20:53:00 -05:00
1 parent 332c1787f4
commit 697497b11e
4 files changed
+39 -62

No files matched your search

-22
View File
@@ -1,22 +0,0 @@
import { useEffect, useState } from 'react';
/**
* @deprecated DO NOT USE; CAUSES NEXT JS HYDRATION ISSUES
*/
export function useWideFormat(size = 880) {
function hasWideFormat() {
return typeof window !== 'undefined' && window.innerWidth > size;
}
const [wideFormat, setWideFormat] = useState(hasWideFormat());
useEffect(() => {
function handleResize() {
setWideFormat(hasWideFormat());
}
window.addEventListener('resize', handleResize);
}, []);
return wideFormat;
}