You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case I see infinite re-renders with warning - Warning: Cannot update a component (SaveButton) while rendering a different component (BooleanInput).
If use const form = useForm(); and <FormProvider {...form}> no warning, but still re-rendering
Error happens when disabled={true}, if set false it works
For TextInput I don't have example, I faced with it in using MUI DataGrid in the columns.renderCell. But I think problem the same.
Environment
React-admin version: 5.4.2
React version: 18.3.1
Hook Form: 7.54.1
The text was updated successfully, but these errors were encountered:
FTR: we had several issues in the past using disabled inputs with react-hook-form. That's why we introduced a readOnly prop on all input components, and we now recommend to use it instead of disabled.
It may solve your issue.
Face in few places of my code with problem that when TextInput has defaultValue, or BooleanInput has disabled=true it give Infinite re-rendering.
As I understood problem somewhere in the - useApplyInputDefaultValues
The simplest example:
In this case I see infinite re-renders with warning -
Warning: Cannot update a component (
SaveButton) while rendering a different component (
BooleanInput).
If use
const form = useForm();
and<FormProvider {...form}>
no warning, but still re-renderingError happens when
disabled={true}
, if setfalse
it worksFor TextInput I don't have example, I faced with it in using MUI DataGrid in the columns.renderCell. But I think problem the same.
Environment
The text was updated successfully, but these errors were encountered: