effect-io-ai

Package: @effect/atom-react
Module: Hooks

Hooks.useAtomRefPropValue

Subscribes to a property ref derived from an atom ref and returns its current value.

When to use

Use when a React component needs only the current value of one property from an object-shaped AtomRef.

Details

The hook composes useAtomRefProp(ref, prop) with useAtomRef, so the property ref is memoized for the [ref, prop] pair and then subscribed through ref.subscribe.

See

Signature

declare const useAtomRefPropValue: <A, K extends keyof A>(ref: AtomRef.AtomRef<A>, prop: K) => A[K]

Source

Since v4.0.0