2
我是否正确理解它? 这两组代码是否意味着相同的东西?它在性能或可靠性方面有什么不同吗?Animated.Event如何在React Native中工作?
<ScrollView
onScroll={Animated.event(
[{nativeEvent: {contentOffset: {y: this.state.scrollY}}}]
)}
>
</ScrollView>
和
handleScroll(e){
this.setState({ scrollY : e.nativeEvent.contentOffset.y });
}
<ScrollView
onScroll={(e) => this.handleScroll(e)}
>
</ScrollView>
感谢