Hi,
I wanted to prepare an element for a later slideInUp() transition, so I tried to apply a slideOutDown(0) transition on it. It seems like a duration of 0 as no effect (you can still see the transition) and I had to use 1 or -1 to achieve that (aka, make the transition immediate). Is that the expected behaviour?
Cheers
I believe this line code would default the duration to 1000
https://github.com/oblador/react-native-animatable/blob/3c286b0a77f27b0848daaf21b4d76de114e5671f/createAnimatableComponent.js#L106
This would need to be changed from duration || 1000 to duration !== undefined ? duration : 1000
Though, a duration of 0 seems like an edge case when using a transitioning component
Thanks for looking into this Mike. I believe that should be fixed.
Imho, a duration of 0 is not an edge case, it's common to use immediate transitions in CSS as well, in conjonction to other "timed" transitions to prepare elements or hide an element immediately after another transition is done. jQuery's transitions also accept durations of 0 so it's common knowledge setting a duration value of 0 will, well, transition for 0 millisecond :-)
Plus, it's far easier to use a duration of 0 rather than to try to replicate the end state manually without a transition component.
Most helpful comment
Thanks for looking into this Mike. I believe that should be fixed.
Imho, a duration of 0 is not an edge case, it's common to use immediate transitions in CSS as well, in conjonction to other "timed" transitions to prepare elements or hide an element immediately after another transition is done. jQuery's transitions also accept durations of 0 so it's common knowledge setting a duration value of 0 will, well, transition for 0 millisecond :-)
Plus, it's far easier to use a duration of 0 rather than to try to replicate the end state manually without a transition component.