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

x/fathym_atomic/src/src.deps.ts>useState

This is the core atomic library to build design libraries from.
Go to Latest
function useState
import { useState } from "https://deno.land/x/fathym_atomic@v0.0.104/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)

Returns

[S, StateUpdater<S>]

Type Parameters

optional
S = undefined

Returns

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