fix: fix bugs

This commit is contained in:
熊潇 2024-11-27 20:02:01 +08:00
parent a2678606a2
commit 810a93628d

View File

@ -9,7 +9,7 @@ export const useContext = (initContext?: GlobalContext) => {
}; };
export const useContextKey = <T>(key: string, init: () => T): T => { export const useContextKey = <T>(key: string, init: () => T): T => {
const _context = useContext(); const _context = useContext({});
if (key && init) { if (key && init) {
_context[key] = init(); _context[key] = init();
return _context[key] as any; return _context[key] as any;