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

    Function arrayOf

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

      Type Parameters

      • T = any

        A value stored in an array.

      Parameters

      • length: number

        The length of the array.

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

        A value or a value provider callback.

      Returns T[]

      An array.

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