fix: exclude multiple children without generic in DialogClose

This commit is contained in:
p-sw 2024-05-24 20:55:35 +09:00
parent 4c63b6bd9d
commit 7d3413451f

View File

@ -217,13 +217,11 @@ const DialogContent = React.forwardRef<HTMLDivElement, DialogContent>(
* ========================= * =========================
*/ */
interface DialogCloseProps<T extends React.ReactNode> { interface DialogCloseProps {
children: T extends any[] ? never : T; children: Exclude<React.ReactNode, Iterable<React.ReactNode>>;
} }
const DialogClose = <T extends React.ReactNode>({ const DialogClose = ({ children }: DialogCloseProps) => {
children,
}: DialogCloseProps<T>) => {
const [_, setState] = useDialogContext(); const [_, setState] = useDialogContext();
// const onClick = () => setState((p) => ({ ...p, opened: false })); // const onClick = () => setState((p) => ({ ...p, opened: false }));