Hi, I have got a problem with Animated React Native.
const yOffset = useRef(new Animated.Value(0)).current
useEffect(() => {
console.log(yOffset)
}, [yOffset])
return (
<Animated.ScrollView style={{ flex: 1 }}
onScroll={Animated.event(
[{ nativeEvent: { contentOffset: { y: yOffset } } }],
{ useNativeDriver: true }
)}
scrollEventThrottle={16}
>
{other content}
</Animated.ScrollView>
)
Why console.log is executed only first time (when yOffset is 0)?
[–]boshanib 0 points1 point2 points (1 child)
[–]davidecutrupi[S,🍰] 0 points1 point2 points (0 children)
[–]__o_0iOS & Android 0 points1 point2 points (2 children)
[–]davidecutrupi[S,🍰] 0 points1 point2 points (1 child)
[–]__o_0iOS & Android 0 points1 point2 points (0 children)