Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

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

👻 Primitive and flexible state management for React
Go to Latest
function useAtom
import { useAtom } from "https://deno.land/x/jotai@v2.7.0/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<any, any[], any>

Parameters

atom: AtomType
optional
options: Options

Type Parameters

AtomType extends Atom<any>

Parameters

atom: AtomType
optional
options: Options