ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
38 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EditContext = void 0;
var react_1 = require("react");
/**
* Context to store the result of the useEditController() hook.
*
* Use the useEditContext() hook to read the context. That's what the Edit components do in react-admin.
*
* @example
*
* import { useEditController, EditContextProvider } from 'ra-core';
*
* const Edit = props => {
* const controllerProps = useEditController(props);
* return (
* <EditContextProvider value={controllerProps}>
* ...
* </EditContextProvider>
* );
* };
*/
exports.EditContext = (0, react_1.createContext)({
record: null,
defaultTitle: null,
isFetching: null,
isLoading: null,
mutationMode: null,
redirect: null,
refetch: null,
resource: null,
save: null,
saving: null,
registerMutationMiddleware: null,
unregisterMutationMiddleware: null,
});
exports.EditContext.displayName = 'EditContext';
//# sourceMappingURL=EditContext.js.map