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

Function getForwardProps

packages/core/src/helpers.ts:158–174  ·  view source on GitHub ↗

* Extract any properties whose keys are *not* reserved for customizing your * animations. All hooks use this function, which means `useTransition` props * are reserved for `useSpring` calls, etc.

(
  props: Props
)

Source from the content-addressed store, hash-verified

156 * are reserved for `useSpring` calls, etc.
157 */
158function getForwardProps<Props extends ReservedProps>(
159 props: Props
160): ForwardProps<Props> | undefined {
161 const forward: any = {}
162
163 let count = 0
164 eachProp(props, (value, prop) => {
165 if (!RESERVED_PROPS[prop]) {
166 forward[prop] = value
167 count++
168 }
169 })
170
171 if (count) {
172 return forward
173 }
174}
175
176/**
177 * Clone the given `props` and move all non-reserved props

Callers 1

inferToFunction · 0.85

Calls 1

eachPropFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…