scrollTo is undefined on animated ScrollView

前端 未结 5 1865
不知归路
不知归路 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:34

    Just adding another answer as both "getNode" and "_component" solution didn't work for me. I'm using react native 0.57. Manage to make it work using scrollToOffset

    componentDidMount() {
      this.refs.listRef.scrollToOffset({ offset: 0,  animated: false })
    }
    
    render() {
      return (
        
      }
    };

提交回复
热议问题