Replace ({ record }) with useRecordContext() (#236)

* replace `({ record })` with `useRecordContext()`

* code style

Co-authored-by: Michael Albert <37796947+awesome-michael@users.noreply.github.com>
This commit is contained in:
Dirk Klimpel
2023-01-24 16:36:08 +01:00
committed by GitHub
parent 8501f19a03
commit 74f77e6988
6 changed files with 24 additions and 9 deletions
+3 -1
View File
@@ -19,6 +19,7 @@ import {
useMutation,
useNotify,
useTranslate,
useRecordContext,
useRefresh,
useUnselectAll,
} from "react-admin";
@@ -105,7 +106,8 @@ export const RoomDirectoryBulkSaveButton = ({ selectedIds }) => {
);
};
export const RoomDirectorySaveButton = ({ record }) => {
export const RoomDirectorySaveButton = props => {
const record = useRecordContext();
const notify = useNotify();
const refresh = useRefresh();
const [create, { loading }] = useCreate("room_directory");