React-native-animatable: transition or transitionTo's callback

Created on 11 Jan 2017  Â·  14Comments  Â·  Source: oblador/react-native-animatable

Hi, I want to have a callback using transition(from, to), but this transition func return undefined..
also I tried onAnimationEnd, it's not fired

Most helpful comment

onTransitionBegin and onTransitionEnd are now available in 1.3.0.

All 14 comments

+1

+1

+1

+1

+1

Seems like this would be pretty easy to write. I tried doing it with a promise but I don't really know how those work exactly.. I accomplish my goal with a timeout

var duration = 2000

    this.refs.Card.transitionTo({height:150},duration)

    setTimeout(()=> {
      console.warn('transition done')
    },duration)

can we have a promised like function for this? something like:

transitionTo(params).then(() => console.log(’transition done’))

+1

+1

+1

@kevando Indeed it's a workaround.. but not look very nice

+1
I hope I can use callback or promise then.
Because too many setTimeout will make my animation slower and pause sometimes.

onTransitionBegin and onTransitionEnd are now available in 1.3.0.

I still want to have a promise, using onTransitionEnd may deal with other situations.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julesmoretti picture julesmoretti  Â·  7Comments

JakeHadley picture JakeHadley  Â·  3Comments

EdmundMai picture EdmundMai  Â·  3Comments

pcfutures picture pcfutures  Â·  4Comments

Aspirationtocode picture Aspirationtocode  Â·  7Comments