Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions apps/v4/hooks/use-mobile.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import * as React from "react"

export function useIsMobile(mobileBreakpoint = 768) {
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
const MOBILE_BREAKPOINT = 768
const MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`

React.useEffect(() => {
const mql = window.matchMedia(`(max-width: ${mobileBreakpoint - 1}px)`)
const onChange = () => {
setIsMobile(window.innerWidth < mobileBreakpoint)
}
mql.addEventListener("change", onChange)
setIsMobile(window.innerWidth < mobileBreakpoint)
return () => mql.removeEventListener("change", onChange)
}, [mobileBreakpoint])
function subscribe(callback: () => void) {
const mql = window.matchMedia(MOBILE_MEDIA_QUERY)

return !!isMobile
mql.addEventListener("change", callback)

return () => {
mql.removeEventListener("change", callback)
}
}

function getSnapshot() {
return window.matchMedia(MOBILE_MEDIA_QUERY).matches
}

function getServerSnapshot() {
return false
}

export function useIsMobile() {
return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)
}
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-luma/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-luma/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-lyra/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-lyra/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-maia/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-maia/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-mira/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-mira/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-nova/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-nova/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-rhea/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-rhea/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-sera/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-sera/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/base-vega/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/base-vega/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/new-york-v4/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/new-york-v4/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/radix-luma/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/radix-luma/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/radix-lyra/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/radix-lyra/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/radix-maia/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/radix-maia/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
2 changes: 1 addition & 1 deletion apps/v4/public/r/styles/radix-mira/use-mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "registry/radix-mira/hooks/use-mobile.ts",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n }\n mql.addEventListener(\"change\", onChange)\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [])\n\n return !!isMobile\n}\n",
"content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\nconst MOBILE_MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nfunction subscribe(callback: () => void) {\n const mql = window.matchMedia(MOBILE_MEDIA_QUERY)\n\n mql.addEventListener(\"change\", callback)\n\n return () => {\n mql.removeEventListener(\"change\", callback)\n }\n}\n\nfunction getSnapshot() {\n return window.matchMedia(MOBILE_MEDIA_QUERY).matches\n}\n\nfunction getServerSnapshot() {\n return false\n}\n\nexport function useIsMobile() {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
"type": "registry:hook"
}
],
Expand Down
Loading
Loading