I'm not sure if this is fixable (but I hope it is). After setting up useFormPersist using the repro steps below, my page where useForm sits gets rerendered on every field change:
import useFormPersist from 'react-hook-form-persist'
const { setValue, watch } = form;
useFormPersist("form-storage", {
watch,
setValue,
storage: window.localStorage
});
By commenting out the useFormPersist command above the problem is resolved but obviously the functionality is gone.
Motivation: Measured by Chrome DevTools / Performance tab, there is a 4-fold performance degradation with this command turned on (moving from 100ms to 400-500ms on my test case).
Suggestion: I think that if possible, the form should be persisted without causing the current element to rerender.
I'm not sure if this is fixable (but I hope it is). After setting up
useFormPersistusing the repro steps below, my page whereuseFormsits gets rerendered on every field change:By commenting out the
useFormPersistcommand above the problem is resolved but obviously the functionality is gone.Motivation: Measured by Chrome DevTools / Performance tab, there is a 4-fold performance degradation with this command turned on (moving from 100ms to 400-500ms on my test case).
Suggestion: I think that if possible, the form should be persisted without causing the current element to rerender.