UNPKG

ra-core

Version:

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

20 lines 547 B
import { createContext } from 'react'; /** * Context to store the current resource name. * * Use the useResource() hook to read the context. That's what most components do in react-admin. * * @example * * import { useResourceContext, useTranslate } from 'ra-core'; * * const MyCustomEditTitle = props => { * const name = useResourceContext(props); * * return ( * <h1>{translate(`${name}.name`)}</h1> * ); * }; */ export var ResourceContext = createContext(undefined); //# sourceMappingURL=ResourceContext.js.map