fix: 素材网格骨架动效避开服务端预渲染访问 window
This commit is contained in:
parent
5f2eb55478
commit
32610b5527
@ -52,7 +52,7 @@ function MaterialGridSkeleton() {
|
||||
const rootRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useGSAP(() => {
|
||||
if (typeof window.matchMedia !== 'function') return
|
||||
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return
|
||||
|
||||
const motion = gsap.matchMedia()
|
||||
motion.add('(prefers-reduced-motion: no-preference)', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user