Stabilize all composed refs#3968
Conversation
🦋 Changeset detectedLatest commit: 7f1c396 The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for this work — #3967 and this PR fix the known call sites, but function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {
// eslint-disable-next-line react-hooks/exhaustive-deps
return React.useCallback(composeRefs(...refs), refs);
}The We've been running this fix in production across Tooltip, Select, Popover and Dialog with React 19.2: function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {
const refsRef = React.useRef(refs);
refsRef.current = refs;
return React.useCallback((node: T) => composeRefs(...refsRef.current)(node), []);
}The |
Filling in the gaps in #3967 and adding test coverage.