Function useRefCallback

  • Returns a ref object and a callback to update the value of this ref.

    Type Parameters

    • T

    Parameters

    • initialValue: T

      The initial ref value.

    Returns [ref: MutableRefObject<T>, refCallback: ((value) => void)]

  • Returns a ref object and a callback to update the value of this ref.

    Type Parameters

    • T

    Parameters

    • initialValue: null | T

      The initial ref value.

    Returns [ref: RefObject<T>, refCallback: RefCallback<T>]

  • Returns a ref object and a callback to update the value of this ref.

    Type Parameters

    • T = undefined

    Returns [ref: MutableRefObject<T | undefined>, refCallback: ((value) => void)]