-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
Prerequisites
- I have read the documentation
What theme are you using?
mui
What is your question?
I've spent the whole day attempting to integrate @refinedev/react-hook-form
with @rjsf/mui
, but the absence of a registration prop on the Form makes it inaccessible for my react-hook-form to receive updates. Merely setting the onChange doesn't seem to suffice. Here's a minimal example:
const ModalForm = ({
modalProps: {
formState,
getValues,
handleSubmit,
modal,
register,
refineCore,
saveButtonProps,
setValue,
...rest
},
supabaseColumns,
}) => {
console.log({
formState,
getValues,
handleSubmit,
modal,
refineCore,
saveButtonProps,
setValue,
...rest,
});
return (
<Form
schema={createSchema(supabaseColumns)}
uiSchema={createUiSchema(supabaseColumns)}
formData={getValues()}
validator={validator}
onChange={(e) =>
Object.entries(e.formData).forEach(([key, value]) =>
setValue(key, value)
)
}
/>
);
};
Help would be appreciated - also worth documenting how to wire data with RHF
.