Module

x/jotai/src/react/useAtom.ts>useAtom

👻 Primitive and flexible state management for React
Latest
function useAtom
import { useAtom } from "https://dotland.deno.dev/x/jotai@v2.10.2/src/react/useAtom.ts";

Type Parameters

Value
Args extends unknown[]
Result

Parameters

optional
options: Options

Returns

[Awaited<Value>, SetAtom<Args, Result>]

Parameters

optional
options: Options

Returns

[Awaited<Value>, SetAtom<[SetStateAction<Value>], void>]

Parameters

atom: Atom<Value>
optional
options: Options

Returns

[Awaited<Value>, never]

Type Parameters

AtomType extends WritableAtom<unknown, never[], unknown>

Parameters

atom: AtomType
optional
options: Options

Type Parameters

AtomType extends Atom<unknown>

Parameters

atom: AtomType
optional
options: Options