-
Hi, I'm trying to use a modal dialog as my edit screen along with DataGrid: const resource = "connections";
const editModalFormProps = useModalForm({
refineCoreProps: { action: "edit", resource },
syncWithLocation: true,
});
...
{
field: "actions",
headerName: "",
sortable: false,
filterable: false,
renderCell: function render({ row }) {
return <>
<EditButton hideText onClick={() => {
showEditModal(row.connection_id);
}} />
<DeleteButton hideText />
</>
},
align: "center",
headerAlign: "center",
minWidth: 40,
},
...
<List createButtonProps={{ onClick: () => showCreateModal() }}>
<DataGrid {...dataGridProps} columns={columns} autoHeight getRowId={(row) => row.connection_id} />
</List>
<EditModal {...editModalFormProps} /> Constantly getting the following error:
According to the source code: /**
* When a custom resource is provided through props, `id` will not be inferred from the URL to avoid any potential faulty requests.
* In this case, `id` is required to be passed through props.
* If `id` is not handled, a warning will be thrown in development mode.
*/
warnOnce(
isIdRequired && !isIdDefined && !isQueryDisabled,
idWarningMessage(action, identifier, id),
); I'm passing the ID with Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @desunit It's a warning, not an error. Just in case you are missing id with edit. The warning might sent because in the first render, you are missing |
Beta Was this translation helpful? Give feedback.
Hey @desunit It's a warning, not an error. Just in case you are missing id with edit. The warning might sent because in the first render, you are missing
row.connection_id
, it could be undefined initially.