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;