Closed ghost closed 7 years ago
When you call selection.transition you are scheduling a transition. The transition doesn’t start until the next animation frame (tick). So, calling d3.active on an element for which you just scheduled a transition, even if that transition’s delay is zero, will return null (unless there was another transition running).
This caused me a lot of problems using d3 with useEffect
in react. A chance set of props changing caused it to schedule two transitions at the same time.
Because they were both within the same tick, active
returned null.
Hi there,
I'm having an issue with d3.active(...). When I try to use it to grab a handle to a running transition, it returns null. The transition is definitely still running at the time I select it.
Seems like a bug, or maybe I misunderstood the documentation. Either way heres an example: https://jsfiddle.net/n92vxdn5/