useEditContext
Returns the context provided by <Edit>, including the current record being edited, the resource name, and the save handler. Use this in custom components rendered inside an edit page.
import { useEditContext } from '@strato-admin/core';
const EditSidebar = () => {
const { record, resource, isPending } = useEditContext();
return (
<p>
Editing {resource} #{record?.id}
</p>
);
};
React-Admin reference
This hook is provided by react-admin. See the full documentation at marmelab.com/react-admin/useEditContext.html.