Skip to main content

useMergeRefs

Callable

  • useMergeRefs<T>(...refs: Refs<T>[]): (value: T | null) => void

  • Returns a function that merges multiple React refs into one.


    Type parameters

    • T

      The type of the ref value

    Parameters

    • rest...refs: Refs<T>[]

      The refs to be merged

    Returns (value: T | null) => void

    A function that sets the value of all merged refs

      • (value: T | null): void
      • Parameters

        • value: T | null

        Returns void