Skip to main content
Module

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

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

Parameters

key: string
initialValue: Value
optional
storage: SyncStorage<Value> | AsyncStorage<Value> = [UNSUPPORTED]

Returns

WritableAtom<Value, [SetStateActionWithReset<Value>], void>