From cd93a5faf22d0aab7694597ed72f630713e1b28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=BE=F0=9D=92=96=F0=9D=92=99=F0=9D=92=89?= Date: Wed, 22 Jan 2025 16:21:37 +0800 Subject: [PATCH] chore: improve TS type --- src/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index c88120d..c902cbb 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -97,7 +97,13 @@ const MODAL_REGISTRY: { props?: Record; }; } = {}; -const ALREADY_MOUNTED = {}; + +const ALREADY_MOUNTED: Record = {}; +declare module 'react' { + interface FunctionComponent { + [symModalId]?: string; + } +} let uidSeed = 0; let dispatch: React.Dispatch = () => { @@ -377,6 +383,7 @@ export function useModal(modal?: any, args?: any): any { ], ); } +// eslint-disable-next-line @typescript-eslint/ban-types export const create =

( Comp: React.ComponentType

, ): React.FC

=> {