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

Function replaceRef

packages/core/src/helpers.ts:221–227  ·  view source on GitHub ↗
(ctrl: Controller, ref?: SpringRef)

Source from the content-addressed store, hash-verified

219
220/** Replace `ctrl.ref` with the given `ref` (if defined) */
221export function replaceRef(ctrl: Controller, ref?: SpringRef) {
222 if (ref && ctrl.ref !== ref) {
223 ctrl.ref?.delete(ctrl)
224 ref.add(ctrl)
225 ctrl.ref = ref
226 }
227}

Callers 3

useTrailFunction · 0.90
useSpringsFunction · 0.90
useTransitionFunction · 0.90

Calls 2

deleteMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…