Spent a few hours on this today & hoping I can save someone else the trouble in the future / perhaps we can improve the docs. I was struggling to replicate even the most basic examples from the website/docs for JavaScript Object targets (not DOM elements) in React without stuff acting weird. My use case was not to move elements around but rather to pass values to subcomponents to animate data (deck.gl in my case).
Things wouldn't move at all or move and then not finish / glitch out / hang. I put together a CodeSandbox with all my attempts. First one doesn't move at all, attempts 2-4 are glitchy, and 5 and 6 work correctly.
Spent a few hours on this today & hoping I can save someone else the trouble in the future / perhaps we can improve the docs. I was struggling to replicate even the most basic examples from the website/docs for JavaScript Object targets (not DOM elements) in React without stuff acting weird. My use case was not to move elements around but rather to pass values to subcomponents to animate data (deck.gl in my case).
Things wouldn't move at all or move and then not finish / glitch out / hang. I put together a CodeSandbox with all my attempts. First one doesn't move at all, attempts 2-4 are glitchy, and 5 and 6 work correctly.
So – the minimal example is:
Also on CodeSandbox. Hope it helps!