Skip to content

Commit 2808991

Browse files
Update hooks/use-mobile.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 87e1e76 commit 2808991

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

hooks/use-mobile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export function useIsMobile() {
77

88
React.useEffect(() => {
99
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
10-
const onChange = () => {
11-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
10+
const onChange = (event: MediaQueryListEvent) => {
11+
setIsMobile(event.matches)
1212
}
1313
mql.addEventListener("change", onChange)
1414
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)

0 commit comments

Comments
 (0)