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

Method _onChange

packages/core/src/SpringValue.ts:972–985  ·  view source on GitHub ↗
(value: T, idle?: boolean)

Source from the content-addressed store, hash-verified

970 }
971
972 protected _onChange(value: T, idle?: boolean) {
973 // Hand `onChange` a real AnimationResult so `result.value` matches the
974 // advertised type, mirroring how `onStart`/`onRest` dispatch their results.
975 // See #2183.
976 const result = getFinishedResult(value, false)
977 if (!idle) {
978 this._onStart()
979 callProp(this.animation.onChange, result, this)
980 }
981 callProp(this.defaultProps.onChange, result, this)
982 // Keep the internal `change` event raw — fluid observers (the animated
983 // tree, the Controller) read the value itself, not a result wrapper.
984 super._onChange(value, idle)
985 }
986
987 // This method resets the animation state (even if already animating) to
988 // ensure the latest from/to range is used, and it also ensures this spring

Callers 3

advanceMethod · 0.95
_setMethod · 0.95
advanceMethod · 0.80

Calls 3

_onStartMethod · 0.95
getFinishedResultFunction · 0.90
callPropFunction · 0.90

Tested by

no test coverage detected