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

Function inferTo

packages/core/src/helpers.ts:180–188  ·  view source on GitHub ↗
(props: T)

Source from the content-addressed store, hash-verified

178 * into the `to` prop.
179 */
180export function inferTo<T extends object>(props: T): InferTo<T> {
181 const to = getForwardProps(props)
182 if (to) {
183 const out: any = { to }
184 eachProp(props, (val, key) => key in to || (out[key] = val))
185 return out
186 }
187 return { ...props } as any
188}
189
190// Compute the goal value, converting "red" to "rgba(255, 0, 0, 1)" in the process
191export function computeGoal<T>(value: T | FluidValue<T>): T {

Callers 4

helpers.test.tsFile · 0.90
createLoopUpdateFunction · 0.90
createUpdateFunction · 0.90
useTransitionFunction · 0.90

Calls 2

eachPropFunction · 0.90
getForwardPropsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…