Hex Core JS
    Preparing search index...

    Function useUpdatingRef

    • Creates a ref that updates when the given value updates. Useful for state variables that are used in asynchronous callbacks (where the state value may become stale).

      Type Parameters

      • T

      Parameters

      • value: T

        The value for which to create a ref.

      Returns MutableRefObject<T>