Combines a possibly undefined forwarded ref with a locally defined ref.
Returns a stable ref object that synchronizes with the forwarded ref.
Best practice: This hook creates a stable local ref and synchronizes it with the forwarded ref.
The returned ref object is stable across renders, preventing infinite loops caused by ref identity changes.
NOTE: This pattern doesn't update refs once they are set. If this is required, use useMergeRefs.
Combines a possibly undefined forwarded ref with a locally defined ref. Returns a stable ref object that synchronizes with the forwarded ref.
Best practice: This hook creates a stable local ref and synchronizes it with the forwarded ref. The returned ref object is stable across renders, preventing infinite loops caused by ref identity changes.
NOTE: This pattern doesn't update refs once they are set. If this is required, use
useMergeRefs.