From 671b5cbb49e007de757e1d5614d94d5c60a83c50 Mon Sep 17 00:00:00 2001 From: Ivan Kudryavtsev Date: Wed, 24 Jan 2024 14:03:45 +0300 Subject: [PATCH] fix(plasma-new-hope): fix id generation for Modal, Popup --- .../plasma-new-hope/src/components/Modal/Modal/Modal.tsx | 6 +++--- packages/plasma-new-hope/src/components/Popup/Popup.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/plasma-new-hope/src/components/Modal/Modal/Modal.tsx b/packages/plasma-new-hope/src/components/Modal/Modal/Modal.tsx index e9b41fe25d..55f47aef1a 100644 --- a/packages/plasma-new-hope/src/components/Modal/Modal/Modal.tsx +++ b/packages/plasma-new-hope/src/components/Modal/Modal/Modal.tsx @@ -1,5 +1,5 @@ import React, { forwardRef } from 'react'; -import { useFocusTrap, useForkRef, useUniqId } from '@salutejs/plasma-core'; +import { useFocusTrap, useForkRef, safeUseId } from '@salutejs/plasma-core'; import { RootProps, component } from '../../../engines'; import { popupConfig } from '../../Popup'; @@ -43,14 +43,14 @@ export const modalRoot = (Root: RootProps) => const innerRef = useForkRef(trapRef, outerRootRef); - const uniqId = useUniqId(); + const uniqId = safeUseId(); const innerId = id || uniqId; const { modalInfo } = useModal({ id: innerId, isOpen, closeOnEsc, onEscKeyDown, onClose, popupInfo }); return ( ) => }, outerRootRef, ) => { - const uniqId = useUniqId(); + const uniqId = safeUseId(); const innerId = id || uniqId; const { isVisible, animationInfo, setVisible } = usePopup({