mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
16 lines
393 B
TypeScript
16 lines
393 B
TypeScript
import { createContext, ReactNode, useContext } from "react";
|
|
|
|
export default function AppContext({ children }: { children: ReactNode }) {
|
|
return (
|
|
<context.Provider value={new Map<string, any>()}>
|
|
{children}
|
|
</context.Provider>
|
|
);
|
|
}
|
|
|
|
const context = createContext<Map<string, any>>(new Map<string, any>());
|
|
|
|
export function useAppContext() {
|
|
return useContext(context);
|
|
}
|