ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
33 lines • 923 B
JavaScript
import { createContext } from 'react';
/**
* Context to store the result of the useCreateController() hook.
*
* Use the useCreateContext() hook to read the context. That's what the Create components do in react-admin.
*
* @example
*
* import { useCreateController, CreateContextProvider } from 'ra-core';
*
* const Create = props => {
* const controllerProps = useCreateController(props);
* return (
* <CreateContextProvider value={controllerProps}>
* ...
* </CreateContextProvider>
* );
* };
*/
export var CreateContext = createContext({
record: null,
defaultTitle: null,
isFetching: null,
isLoading: null,
redirect: null,
resource: null,
save: null,
saving: null,
registerMutationMiddleware: null,
unregisterMutationMiddleware: null,
});
CreateContext.displayName = 'CreateContext';
//# sourceMappingURL=CreateContext.js.map