Relative Content

Tag Archive for reactjsreact-hook-form

Integrate RHF into MUI Autocomplete

I have a component TimePickerOwn which consists of two subcomponents which represent 2 MUI Autocompletes. This component acts as a TimePicker which contains different times with 30 minute interval in select dropdown, also arrows on each side can be clicked to add/subtract 30 minutes and manual text input can be done as well which on blur formats time to keep it in 30 min intervals. If user enter 12:33, on blur it will be formatted to 12:30, for example.

react-hook-form setValues looses reactivity in nested component

I’m working on a React form using React Hook Form and Zod. Most fields are primitive but there is one that requires an additional nested component. This field is an array and the nested component provides some operations to add and remove elements.

react-hook-form setValues looses reactivity in nested component

I’m working on a React form using React Hook Form and Zod. Most fields are primitive but there is one that requires an additional nested component. This field is an array and the nested component provides some operations to add and remove elements.

Get value of field before getting dirty in React Hook Form

I have profile component that takes some values from context and then edits them based on user interaction, when function editProfile is triggered after submitting the form, i check if the image has changed using the isDirty method, if so then i take the new image url and upload it to firebase, but i need to delete the previous image as it has been changed, how can i get the value of the previous image ?

Get value of field before change in React Hook Form

I have profile component that takes some values from context and then edits them based on user interaction, when function editProfile is triggered after submitting the form, i check if the image has changed using the isDirty method, if so then i take the new image url and upload it to firebase, but i need to delete the previous image as it has been changed, how can i get the value of the previous image ?