My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

React Native: Animating when component is visible

Baran Kucukguzel's photo
Baran Kucukguzel
·Jan 12, 2017

I have a component which I am animating with Animated, my application is an tabbed application(I use react-native-navigation) and I want to animate this component when it is shown in the screen, not when it mounts. I have tried starting animation on componentDidMount and componentWillReceiveProps but the problem is that the component is in the second tab and it is not visible when it mounts. How can I detect when this component becomes visible and animate it?