@@ -91,14 +91,14 @@ export const ParallaxLayer = React.memo(
91
91
setPosition ( height , scrollTop , immediate = false ) {
92
92
const targetScroll = Math . floor ( offset ) * height
93
93
const distance = height * offset + targetScroll * speed
94
- ctrl . update ( {
94
+ ctrl . start ( {
95
95
translate : - ( scrollTop * speed ) + distance ,
96
96
config : parent . config ,
97
97
immediate,
98
98
} )
99
99
} ,
100
100
setHeight ( height , immediate = false ) {
101
- ctrl . update ( {
101
+ ctrl . start ( {
102
102
space : height * factor ,
103
103
config : parent . config ,
104
104
immediate,
@@ -120,11 +120,13 @@ export const ParallaxLayer = React.memo(
120
120
}
121
121
} )
122
122
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
+ )
128
130
129
131
return (
130
132
< AnimatedView
@@ -135,7 +137,7 @@ export const ParallaxLayer = React.memo(
135
137
backgroundRepeat : 'no-repeat' ,
136
138
willChange : 'transform' ,
137
139
[ horizontal ? 'height' : 'width' ] : '100%' ,
138
- [ horizontal ? 'width' : 'height' ] : ctrl . animated . space ,
140
+ [ horizontal ? 'width' : 'height' ] : ctrl . get ( ' space' ) ,
139
141
WebkitTransform : translate3d ,
140
142
MsTransform : translate3d ,
141
143
transform : translate3d ,
0 commit comments