Closed anshul-kai closed 7 years ago
Hi, delay
is only supported for the animation
prop. Try using the fadeIn
/fadeOut
animations.
I see. Thank you for the reminder. I remember this being the issue with the onAnimationBegin
and onAnimationEnd
callbacks as well. Perhaps, adding this to the documentation would avoid future confusion?
Are there any considerations to make these work for non-animation prop animations? My guess would be that there are some potential design barriers preventing this from being implemented. If not, I'm happy to look into providing a PR.
@a-koka Yes, the problem is that transitions are a slightly different beast where the different properties are animated indepently and might theoretically finish at different times.
Then why wouldn't we just say callbacks aren't supported for transitions, rather than delay? I already made a pull request for transition delay
@a-koka hi, i wonder how to use the props transition, i try to set transition='opacity' ,but i don`t know how it transition to the opacity that i want. can you give me a simple demo, how to use the props transition . Thanks a lot.
Hi @walkerXiong, you may want to create a separate issue or post on StackOverflow for non-bug questions in the future. This helps the authors to stay focused on actual bugs and it avoids cluttering actual issues.
What you're trying to achieve is simple. When the value of opacity
below changes, the View
will animate those changes for you.
const opacity = this.state.opacity; // Change this using this.setState({opacity: 1})
<Animatable.View transition='opacity' duration={500} delay={5000} style={{opacity: opacity}}>
I also ran into this issue.. very confusing.. Thanks @br4nnigan for fix here: https://github.com/oblador/react-native-animatable/pull/108
The view below is completely ignoring the delay on RN 0.42.0