Skip to content

Commit fe9df56

Browse files
committed
refactor: simplify Menu id generation
1 parent 8784282 commit fe9df56

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ const Menu = React.forwardRef<MenuRef, MenuProps>((props, ref) => {
259259

260260
const containerRef = React.useRef<HTMLUListElement>(null);
261261

262-
const mergedUuid = useId();
263-
const uuid = useId(id ? `rc-menu-uuid-${id}` : `rc-menu-uuid-${mergedUuid}`);
262+
const mergedId = useId(id);
263+
const uuid = `rc-menu-uuid-${mergedId}`;
264264

265265
const isRtl = direction === 'rtl';
266266

0 commit comments

Comments
 (0)