La referencia de la API está disponible solo en inglés por ahora.

UseAtomicProp<R extends string, S extends Record<R, any>>

type
react/src/hooks/createHooks.ts:47

Call signature for the typed useAtomicProp hook returned by createHooks. Subscribes to a specific dotted path in a reducer's state and re-renders only when that path changes. All type parameters are inferred automatically from the store context — no explicit generics needed.

Definition

type
type UseAtomicProp<R extends string, S extends Record<R, any>> = (reducer: R1, accessor: (state: DeepReadonly<S[R1]>) => V, isEqual?: (a: V, b: V) => boolean) => V

(reducer: R1, accessor: (state: DeepReadonly<S[R1]>) => V, isEqual?: (a: V, b: V) => boolean) => V

Type parameters

NameTypeDescription
Rextends stringReducer name union.
Sextends Record<R, any>State record keyed by R.