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> {
children: T extends any[] ? never : T;
interface DialogCloseProps {
children: Exclude<React.ReactNode, Iterable<React.ReactNode>>;
}
const DialogClose = <T extends React.ReactNode>({
children,
}: DialogCloseProps<T>) => {
const DialogClose = ({ children }: DialogCloseProps) => {
const [_, setState] = useDialogContext();
// const onClick = () => setState((p) => ({ ...p, opened: false }));