Helpful
    Preparing search index...

    Function useStateAsArray

    • A helpful hook for when you can have a single value or array value and you always need an array value.

      Type Parameters

      • T

      Parameters

      • Optionalinitial: T | T[]

        The initial value. Note that the default for undefined values is the empty array.

      Returns [T[], ZSetStateAsArray<T>]

      A state tuple where the first item is the current value cast to an array, and the second item is the setter for the value.