Skip to content

Commit 7a93b47

Browse files
refactor(eui): memoize before combining ref
1 parent 34e2f32 commit 7a93b47

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/eui/src/components/flyout/manager/flyout_managed.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ export const EuiManagedFlyout = forwardRef<HTMLElement, EuiManagedFlyoutProps>(
8686
) => {
8787
const flyoutId = useFlyoutId(id);
8888
const [flyoutRef, setFlyoutRef] = useState<HTMLElement | null>(null);
89-
const combinedRef = useCombinedRefs([setFlyoutRef, ref]);
89+
90+
const refs = useMemo(() => [setFlyoutRef, ref], [ref]);
91+
const combinedRef = useCombinedRefs(refs);
9092

9193
const {
9294
addFlyout,

0 commit comments

Comments
 (0)