1
0
forked from boos/BoosAPI

fix: guard useIsMobile in non-browser

This commit is contained in:
cita
2026-03-10 16:14:37 +08:00
parent 715a2dba9b
commit 1dbde9346a
+1
View File
@@ -6,6 +6,7 @@ export function useIsMobile(breakpoint = 768) {
));
useEffect(() => {
if (typeof window === 'undefined') return;
const update = () => setIsMobile(window.innerWidth < breakpoint);
update();
window.addEventListener('resize', update);