UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

11 lines 492 B
import { createContext, useContext } from 'react'; export const ReferenceFieldContext = createContext(null); export const ReferenceFieldContextProvider = ReferenceFieldContext.Provider; export const useReferenceFieldContext = () => { const context = useContext(ReferenceFieldContext); if (!context) { throw new Error('useReferenceFieldContext must be used inside a ReferenceFieldContextProvider'); } return context; }; //# sourceMappingURL=ReferenceFieldContext.js.map