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

x/jotai/src/vanilla/utils.ts>atomWithDefault

👻 Primitive and flexible state management for React
Latest
function atomWithDefault
import { atomWithDefault } from "https://deno.land/x/jotai@v2.10.2/src/vanilla/utils.ts";

Parameters

getDefault: Read<Value, [SetStateAction<Value> | RESET], void>

Returns

WritableAtom<Value, [SetStateAction<Value> | RESET], void>