Reference

useActionState

Tracks state and pending status for an action that receives the previous state.

Signature

function useActionState<TState, TPayload>(action: (previousState: TState, payload: TPayload): TState | Promise<TState>, initialState: TState): [TState, (payload: TPayload): void, boolean]