Skip to content

Commit 6585865

Browse files
committed
replace useRef with useId
1 parent c40135f commit 6585865

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/Core/BreadcrumbFeedbackHeader.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Button, FlexBox, FlexBoxAlignItems, Menu, MenuItem } from '@ui5/webcomp
33
import { useTranslation } from 'react-i18next';
44
import { FeedbackButton } from './FeedbackButton.tsx';
55
import { BetaButton } from './BetaButton.tsx';
6-
import { useRef, useState } from 'react';
6+
import { useId, useState } from 'react';
77
import { useAuthOnboarding } from '../../spaces/onboarding/auth/AuthContextOnboarding.tsx';
88
import { SearchParamToggleVisibility } from '../Helper/FeatureToggleExistance.tsx';
99
import { PathAwareBreadcrumbs } from './PathAwareBreadcrumbs/PathAwareBreadcrumbs.tsx';
@@ -30,20 +30,20 @@ export function BreadcrumbFeedbackHeader() {
3030
function LogoutMenu() {
3131
const auth = useAuthOnboarding();
3232
const { t } = useTranslation();
33+
const openerId = useId();
3334

34-
const buttonRef = useRef(null);
3535
const [menuIsOpen, setMenuIsOpen] = useState(false);
3636
return (
3737
<>
3838
<Button
39-
ref={buttonRef}
39+
id={openerId}
4040
icon="menu2"
4141
onClick={() => {
4242
setMenuIsOpen(true);
4343
}}
4444
/>
4545
<Menu
46-
opener={buttonRef.current}
46+
opener={openerId}
4747
open={menuIsOpen}
4848
onClose={() => {
4949
setMenuIsOpen(false);

0 commit comments

Comments
 (0)