chenglou / react-tween-state

React animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the best way to listen for update after the first tween frame

BrennanRoberts opened this issue · comments

Sorry for the awkward title.

Let's say we're tweening opacity, and setting "display: getTweeningValue === 0 ? 'none' : 'block'". We have something we only want to call after opacity goes from 0 to >0, but since tweenState mutates state, we can't use prevState in componentDidUpdate.

Any ideas?