MCPcopy
hub / github.com/pmndrs/react-spring / set

Method set

packages/core/src/SpringValue.ts:401–411  ·  view source on GitHub ↗

Set the current value, while stopping the current animation

(value: T | FluidValue<T>)

Source from the content-addressed store, hash-verified

399
400 /** Set the current value, while stopping the current animation */
401 set(value: T | FluidValue<T>) {
402 raf.batchedUpdates(() => {
403 this._stop()
404
405 // These override the current value and goal value that may have
406 // been updated by `onRest` handlers in the `_stop` call above.
407 this._focus(value)
408 this._set(value)
409 })
410 return this
411 }
412
413 /**
414 * Freeze the active animation in time, as well as any updates merged

Callers 2

describeEventsFunction · 0.95
describeMethodsFunction · 0.95

Calls 3

_stopMethod · 0.95
_focusMethod · 0.95
_setMethod · 0.95

Tested by 2

describeEventsFunction · 0.76
describeMethodsFunction · 0.76