From 810a93628d326bf6af66c289c54a9f038366faa7 Mon Sep 17 00:00:00 2001 From: xion Date: Wed, 27 Nov 2024 20:02:01 +0800 Subject: [PATCH] fix: fix bugs --- src/context.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.ts b/src/context.ts index 90c4116..12688ac 100644 --- a/src/context.ts +++ b/src/context.ts @@ -9,7 +9,7 @@ export const useContext = (initContext?: GlobalContext) => { }; export const useContextKey = (key: string, init: () => T): T => { - const _context = useContext(); + const _context = useContext({}); if (key && init) { _context[key] = init(); return _context[key] as any;