Skip to content

API Reference / @gtkx/animated / useSpringValue

Variable: useSpringValue ​

const useSpringValue: <T>(initial, props?) => SpringValue<T>

Creates a constant single SpringValue that can be interacted with imperatively. This is an advanced API and does not react to updates from the parent component e.g. passing a new initial value

Type Parameters ​

T ​

T

Parameters ​

initial ​

Exclude<T, object>

– The initial value of the SpringValue.

props? ​

SpringUpdate<T>

– Typically the same props as useSpring e.g. config, loop etc.

Returns ​

SpringValue<T>