Hex Core JS
    Preparing search index...

    Function setStateActionAsValue

    • Resolves the given set-state action to a value by calling the action with the previous value if it as a callback-type action or by simply returning the action if it is a value.

      Type Parameters

      • T

      Parameters

      • prev: T

        The previous state value.

      • action: SetStateAction<T>

        The SetStateAction to resolve.

      Returns T

      Only works for non-function type states.