FIG-001/ CALLBACK

every value, every frame.

The box loops x and rotate. Its onUpdate prop receives every latest value once per frame, and the readout prints them as they change.

  • onUpdate runs once per frame while any value changes, never more.
  • latest holds every value on the element, not only the one that changed.
  • Having onUpdate keeps the element's transforms on the main thread instead of the compositor.
↩ all examples
api · onUpdateinput · animate={{ x, rotate }}mode · live mode · live running source
// on-update frames: 0
latest.x
—
latest.rotate
—
onUpdate(latest) every value, every frame
category · callback
sheet · sheet 01 / 01
⟳ to re-run

onUpdate