progress
This commit is contained in:
parent
85b91793b5
commit
c212a837cd
|
@ -1,4 +1,3 @@
|
|||
"use client"
|
||||
import { RefObject, useMemo, useSyncExternalStore } from "react"
|
||||
|
||||
function subscribe(callback: (e: Event) => void) {
|
||||
|
@ -15,6 +14,10 @@ function useDimensions(ref: RefObject<HTMLElement>) {
|
|||
width: ref.current?.offsetWidth ?? 0,
|
||||
height: ref.current?.offsetHeight ?? 0,
|
||||
}),
|
||||
() => JSON.stringify({
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight
|
||||
})
|
||||
)
|
||||
return useMemo(() => JSON.parse(dimensions), [dimensions])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue