react-native-animatable
react-native-animatable copied to clipboard
Can fadeOut animations have a delay?
I'm kinda goin crazy here
Yes, what code are you trying with?
I would like to display a text response, and have it fadeout 5 seconds later. And if the user does that action again, do show the same status and then fadeout 5 seconds later.
I did it using timeout, it just seemed like it would be part of this library.
If you use the declarative way then it's supported with the delay prop.
Can you provide an example of what that means? I tried a lot of things to get this to work.
There's plenty of examples – see the part of the documentation about declarative usage or the example project.
Yeah it seems the delay only works when it animates from componentDidMount or wherever it initializes from. If I try to run that animation again, I don't see a delay.
@kevando, you can check this to fix delay issue
Hi @kevando,
Not sure if this applies to you, but try using the iterationDelay prop - that sort of did the trick for me:
<Animatable.View
duration={1000}
iterationDelay={300}
animation={
this.state.menuOpen ? "fadeIn" : "fadeOut"
}
useNativeDriver={true}
>
...
</Animatable.View>
^ I'm using version 1.3.2