Home > @findkit/ui > PreactFunctions > useState

PreactFunctions.useState() method

Signature:

useState<S>(this: void, initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];

Parameters

Parameter Type Description
this void
initialState S | (() => S)

Returns:

[S, Dispatch<SetStateAction<S>>]