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

Method _focus

packages/core/src/SpringValue.ts:898–909  ·  view source on GitHub ↗

Update the `animation.to` value, which might be a `FluidValue`

(value: T | FluidValue<T>)

Source from the content-addressed store, hash-verified

896
897 /** Update the `animation.to` value, which might be a `FluidValue` */
898 protected _focus(value: T | FluidValue<T>) {
899 const anim = this.animation
900 if (value !== anim.to) {
901 if (getFluidObservers(this)) {
902 this._detach()
903 }
904 anim.to = value
905 if (getFluidObservers(this)) {
906 this._attach()
907 }
908 }
909 }
910
911 protected _attach() {
912 let priority = 0

Callers 3

setMethod · 0.95
stopMethod · 0.95
_mergeMethod · 0.95

Calls 3

_detachMethod · 0.95
_attachMethod · 0.95
getFluidObserversFunction · 0.90

Tested by

no test coverage detected