react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

Can fadeOut animations have a delay?

Open kevando opened this issue 9 years ago • 8 comments

I'm kinda goin crazy here

kevando avatar Aug 21 '16 04:08 kevando

Yes, what code are you trying with?

oblador avatar Aug 21 '16 15:08 oblador

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.

kevando avatar Aug 21 '16 15:08 kevando

If you use the declarative way then it's supported with the delay prop.

oblador avatar Aug 21 '16 15:08 oblador

Can you provide an example of what that means? I tried a lot of things to get this to work.

kevando avatar Aug 21 '16 15:08 kevando

There's plenty of examples – see the part of the documentation about declarative usage or the example project.

oblador avatar Aug 21 '16 15:08 oblador

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 avatar Aug 21 '16 17:08 kevando

@kevando, you can check this to fix delay issue

colorhaake avatar Sep 23 '16 07:09 colorhaake

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

bberak avatar Aug 08 '19 08:08 bberak