Closed stephenscaff closed 7 months ago
useEventListener
window is undefined
requestRef
previousTimeRef
refs
useRef<number | null>(null)
requestRef.current
cursorInnerRef.current
cursorOuterRef.current
IsDevice
The updates should prevent errors and warning in Next.js / SSR environment, and make it so you no longer have to do a dynamic import.
Updates
useEventListener
hook to be more SSR/Next friendly. This should addresswindow is undefined
errors.requestRef
andpreviousTimeRef
refs
touseRef<number | null>(null)
requestRef.current
cursorInnerRef.current
andcursorOuterRef.current
IsDevice
Results
The updates should prevent errors and warning in Next.js / SSR environment, and make it so you no longer have to do a dynamic import.