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
Go to Latest
function atomWithDefault
import { atomWithDefault } from "https://deno.land/x/jotai@v2.9.1/src/vanilla/utils.ts";

Parameters

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

Returns

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