ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
19 lines • 628 B
JavaScript
import { useContext } from 'react';
import { CreateContext } from './CreateContext';
/**
* Hook to read the create controller props from the CreateContext.
*
* Used within a <CreateContextProvider> (e.g. as a descendent of <Create>).
*
* @returns {CreateControllerResult} create controller props
*
* @see useCreateController for how it is filled
*/
export var useCreateContext = function () {
var context = useContext(CreateContext);
if (!context) {
throw new Error('useCreateContext must be used inside a CreateContextProvider');
}
return context;
};
//# sourceMappingURL=useCreateContext.js.map