React Hookers - v6.3.0
    Preparing search index...

    Function arrayOf

    • Creates an array of the given length and fills it with a value.

      Type Parameters

      • T = any

        The type of values stored in the array.

      Parameters

      • length: number

        The length of the array.

      • Optionalvalue: T | ((index: number) => T)

        A value or a value-provider callback.

      Returns T[]

      The created array.

      // Create an array of 3 element refs
      const refs = useFunction(arrayOf, 3, createRef<Element>);