useStateWithUpdater<T> function

(T, StateSetter<T>) useStateWithUpdater<T>(
  1. T initial
)

Returns state with a setter that supports functional updates.

useState also returns this setter type; this named form makes the functional-update capability explicit at call sites. See https://react.dev/reference/react/useState.

Implementation

(T, StateSetter<T>) useStateWithUpdater<T>(T initial) =>
    currentReactRuntime.binding.useStateWithUpdater(initial);