Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
function useState
Re-export
import { useState } from "https://deno.land/x/fathym_atomic_design_kit@v0.0.113-integration/src/src.deps.ts";

Returns a stateful value, and a function to update it.

Parameters

initialState: S | (() => S)

The initial value (or a function that returns the initial value)

Type Parameters

optional
S = undefined

Returns

[S | undefined, Dispatch<StateUpdater<S | undefined>>]