We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33d301a commit 7732c0cCopy full SHA for 7732c0c
resources/js/hooks/use-mobile.tsx
@@ -12,9 +12,10 @@ function mediaQueryListener(callback: (event: MediaQueryListEvent) => void) {
12
};
13
}
14
15
+function isSmallerThanBreakpoint() {
16
+ return window.innerWidth < MOBILE_BREAKPOINT;
17
+}
18
+
19
export function useIsMobile() {
- return useSyncExternalStore(
- mediaQueryListener,
- () => window.innerWidth < MOBILE_BREAKPOINT,
- );
20
+ return useSyncExternalStore(mediaQueryListener, isSmallerThanBreakpoint);
21
0 commit comments