title: How to add a function call to Animated.sequence in react native
body: <p>I have a button at the middle of my screen. onScroll I want the button to scale down to 0 to disappear and then scale back up to 1 to reappear in a new position at the bottom of the screen. I want to be able call setState (which controls the position of the button) in between the scale down and scale up animations. Something like the code below. Any idea of the best way to add a function call in between these two animations? Or an even better way of doing this?</p>
  
  <pre><code>animateScale = () =&gt; {
   return (
     Animated.sequence([
       Animated.timing(
         this.state.scale,
         {
           toValue: 0,
           duration: 300
         }
       ),
       this.setState({ positionBottom: true }),
       Animated.timing(
         this.state.scale,
         {
           toValue: 1,
           duration: 300
         }
       )
     ]).start()
   )
  </code></pre>
  
  <p>}</p>