@@ -91,14 +91,14 @@ export const ParallaxLayer = React.memo(
9191 setPosition ( height , scrollTop , immediate = false ) {
9292 const targetScroll = Math . floor ( offset ) * height
9393 const distance = height * offset + targetScroll * speed
94- ctrl . update ( {
94+ ctrl . start ( {
9595 translate : - ( scrollTop * speed ) + distance ,
9696 config : parent . config ,
9797 immediate,
9898 } )
9999 } ,
100100 setHeight ( height , immediate = false ) {
101- ctrl . update ( {
101+ ctrl . start ( {
102102 space : height * factor ,
103103 config : parent . config ,
104104 immediate,
@@ -120,11 +120,13 @@ export const ParallaxLayer = React.memo(
120120 }
121121 } )
122122
123- const translate3d = ctrl . animated . translate . interpolate (
124- horizontal
125- ? x => `translate3d(${ x } px,0,0)`
126- : y => `translate3d(0,${ y } px,0)`
127- )
123+ const translate3d = ctrl
124+ . get ( 'translate' )
125+ . to (
126+ horizontal
127+ ? x => `translate3d(${ x } px,0,0)`
128+ : y => `translate3d(0,${ y } px,0)`
129+ )
128130
129131 return (
130132 < AnimatedView
@@ -135,7 +137,7 @@ export const ParallaxLayer = React.memo(
135137 backgroundRepeat : 'no-repeat' ,
136138 willChange : 'transform' ,
137139 [ horizontal ? 'height' : 'width' ] : '100%' ,
138- [ horizontal ? 'width' : 'height' ] : ctrl . animated . space ,
140+ [ horizontal ? 'width' : 'height' ] : ctrl . get ( ' space' ) ,
139141 WebkitTransform : translate3d ,
140142 MsTransform : translate3d ,
141143 transform : translate3d ,
0 commit comments