scrollTo is undefined on animated ScrollView

前端 未结 5 1869
不知归路
不知归路 2021-02-02 08:03

When using Animated.createAnimatedComponent(ScrollView) to create an animated ScrollView it\'s not longer possible to use scrollTo.

<
5条回答
  •  春和景丽
    2021-02-02 08:43

    Try this to get the ref of the component returns from Animated.createAnimatedComponent method:

    ref={(ref) => this.list = ref._component}
    

    Then, calling this.list.scrollTo({x: 0, y: 0}) should work.

提交回复
热议问题