Helpful
    Preparing search index...
    • Represents a useState where changing the initial state resets the internal state.

      This is useful for form like flows where you internally keep track of changes to data, commit the changes, and then want to reflect the new updated state.

      Type Parameters

      • S

      Parameters

      • initial: S | (() => S)

        The initial state or a callback to retrieve the initial state.

      Returns [S, Dispatch<SetStateAction<S>>]

      A set state tuple where the first value is the current set value, and the 2nd value is a setter for the internal state.