From 884af7c7e4706a8268ac3a0d9f55fed042fdd583 Mon Sep 17 00:00:00 2001 From: Damian Stasik <920747+damianstasik@users.noreply.github.com> Date: Sat, 23 Mar 2024 16:15:19 +0100 Subject: [PATCH] Make component and props' types optional in the standalone show function --- src/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 9e4f5b7..c13d055 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -219,10 +219,11 @@ type NiceModalArgs = T extends keyof JSX.IntrinsicElements | React.JSXElement ? React.ComponentProps : Record; -export function show>>>( - modal: React.FC, - args?: P, -): Promise; +export function show< + T extends any, + C extends any = any, + P extends Partial>> = Partial>>, +>(modal: React.FC, args?: P): Promise; export function show(modal: string, args?: Record): Promise; export function show(modal: string, args: P): Promise;