title: React Native ScrollView scrollTo function is not working
body: <p>I'm trying to make scroll to the top, if a certain condition is met, in the component's <code>componentWillReceiveProps</code> event ... but nothing happens:</p>
  
  <pre><code>componentWillReceiveProps(nextProps) {
       // some code...
  
      if (newQuery === query &amp;&amp; this.scrollViewRef.current) {
        console.log('Should scroll to top'); // &lt;&lt; logs successfully
  
        this.scrollViewRef.current.scrollTo({
          x: 0,
          y: 0,
          duration: 500,
          animated: true,
        });
      }
    }
  </code></pre>
  
  <p>Code snippet of how I created ref for the scrollView:</p>
  
  <pre><code>class SearchResult extends React.Component {
    constructor(props) {
      super(props);
  
      this.scrollViewRef = React.createRef();
    }
  //...
  }
  </code></pre>
  
  <p>render method:</p>
  
  <pre><code>render () {
     return (
        &lt;ScrollView
          ref={this.scrollViewRef}
          contentContainerStyle={{ marginVertical: 8 }}
        &gt;
      ...
      )
  }
  </code></pre>
  
  <p>I also tried to scroll manually via a button press ... doesn't work as well</p>
  
  <p>Any help ?</p>