mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 13:38:51 +00:00
Update component and optimized code
This commit is contained in:
@@ -7,7 +7,7 @@ import { IDialogProps } from '../../globals/interfaces';
|
||||
import { StyledBody, StyledDialog, StyledTitle } from './styled';
|
||||
|
||||
const Dialog = forwardRef((props, ref) => {
|
||||
const { title, children, onClose } = props as IDialogProps;
|
||||
const { title, children, onClose } = props as IDialogProps<unknown>;
|
||||
return (
|
||||
<StyledDialog
|
||||
ref={ref as React.LegacyRef<HTMLDialogElement> | undefined}
|
||||
@@ -17,6 +17,6 @@ const Dialog = forwardRef((props, ref) => {
|
||||
<StyledBody>{children}</StyledBody>
|
||||
</StyledDialog>
|
||||
);
|
||||
}) as React.FC<IDialogProps>;
|
||||
}) as React.FC<IDialogProps<unknown>>;
|
||||
|
||||
export default Dialog;
|
||||
|
||||
Reference in New Issue
Block a user