File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import React, {
5
5
useEffect ,
6
6
CSSProperties ,
7
7
} from 'react'
8
- import { requestAnimationFrame , defaultElement as View } from 'shared/globals'
8
+ import { frameLoop , defaultElement as View } from 'shared/globals'
9
9
import { Controller , SpringConfig , config as configs } from '@react-spring/core'
10
10
import { withAnimated } from '@react-spring/animated'
11
11
import { useMemoOne } from 'use-memo-one'
@@ -239,7 +239,7 @@ export const Parallax = React.memo(
239
239
if ( ! state . busy ) {
240
240
state . busy = true
241
241
state . current = event . target [ getScrollType ( horizontal ) ]
242
- requestAnimationFrame ( ( ) => {
242
+ frameLoop . onFrame ( ( ) => {
243
243
state . layers . forEach ( layer =>
244
244
layer . setPosition ( state . space , state . current )
245
245
)
@@ -254,7 +254,7 @@ export const Parallax = React.memo(
254
254
255
255
const onResize = ( ) => {
256
256
const update = ( ) => state . update ( )
257
- requestAnimationFrame ( update )
257
+ frameLoop . onFrame ( update )
258
258
setTimeout ( update , 150 ) // Some browsers don't fire on maximize!
259
259
}
260
260
You can’t perform that action at this time.
0 commit comments