fix: exclude multiple children without generic in DialogClose
This commit is contained in:
parent
4c63b6bd9d
commit
7d3413451f
@ -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 }));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user