Skip to main content

useState

function

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

function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>] function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>]

Import

import { useState } from '@modular/sdk/editor';

Notes

version
16.8.0
see
{@link https://react.dev/reference/react/useState}
version
16.8.0
see
{@link https://react.dev/reference/react/useState}