title: React-Native Animate View In and Out
body: <p>Currently, I am struggling with appearing and disappearing animations..
  My aim is to animate a view in and again out.. but I want also that the view does 100% disappear after the animation</p>
  <p><strong>Idea</strong></p>
  <pre><code>    ...
  
  const visible: boolean = props.visible || false;
  const [showView, setShowView] = useState&lt;boolean&gt;(visible);
  const viewAnimation = useRef&lt;Animatable.View &amp; View&gt;(null);
  
     useEffect(() =&gt; {
          const Animation = async () =&gt; {
  
              if (visible) {
                  setShowView(true);
                  if (viewAnimation.current)
                      await viewAnimation.current.bounceIn(2000);
              } else {
                  if (viewAnimation.current)
                      await viewAnimation.current.bounceOut(2000);
                  setShowView(false)
              }
          }
  
          Animation();
      }, [visible, viewAnimation]);
  
  ...
  
  {showView &amp;&amp;
  &lt;Animatable.View ref={viewAnimation}&gt;
  ...
  &lt;/Animatable.View&gt;
  }
  
  ...
  
  </code></pre>
  <p><strong>Problem</strong>
  The viewAnimationRef get set in the next render cycle and not instant after setting the showView to true
  -&gt; the bounceIn animation will never get executed.. because viewAnimation.current is null..</p>
  <p>I am using:</p>
  <ul>
  <li>react-native 0.62</li>
  <li>react-native-animatable 1.3.3</li>
  </ul>
  <p>Maybe sb has an idea how to solve this problem ^^</p>
  <p>Thank you</p>