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 mv-tmp. * * @example * * import { useResourceContext, useTranslate } from 'ra-core'; * * const MyCustomEditTitle = props => { * const name = useResourceContext(props); * * return ( *

{translate(`${name}.name`)}

* ); * }; */ export const ResourceContext = createContext(undefined); export type ResourceContextValue = string;