UNPKG

@sparklink-pro/apant

Version:

Apollo & Antd tools

15 lines 434 B
import { useContext, createContext } from 'react'; // Create a context to share the registy. export const TypesContext = createContext(null); /** * Hook to get the registry. */ export function useRegistry() { const registry = useContext(TypesContext); if (!registry) { throw new Error(`Types registry is not defined.`); } return registry; } export default useRegistry; //# sourceMappingURL=useRegistry.js.map