I just wanna say thank you, Bill. I just get started to use reack form hook with nextjs and I am in love with it. Thank you a lot, It makes my form so much better and clean.
Thank you, Bill! A video about Dependent Fields would be great! (Change of A leads to change of B etc.) Very important in my opinion, and I don't see any possibility to achieve this with React-Hook-Form. Or at least not in a way without lots of re-rendering.
Just watched your whole playlist, so I can't remember if this is the correct video to comment this question on. If I set defaultValue for "age" field to 0, set its type to be number, and then in the input I use "valueAsNumber", it automatically displays 0 in the field when the component renders. I'd like it to be blank (show an empty field) instead, and also have isDirty be false when the field is empty (or if I type something in, but then delete it to be empty again), but I can't figure out it might be possible to do that appropriately. Is there a way? Or am I not thinking far enough ahead, and that would be a poor/awkward UX overall? I was just thinking it would be nice to have all the fields blank when the user first gets to the form, but maybe that isn't often the case when for most valueAsNumber fields anyway. (And I like the idea of my form values being of the data type I want (i.e. numberAsValue) without having to handle that elsewhere, which is why I was looking into this)
and, when he erased the letter of input the placeholders back normally not because of the defaultValue. The video didn't' show how to use defaultValue...
Hello. Can you please elaborate on how you managed to update a component through proxy if it subscribed to any form state, i.e. const { isDirty } = formState? For example, I have my Button component, where I destructured the form state like in your example. When some update happens, it goes through proxy's setter, right? And then useState changes? But in this case, I have to rerender my main component that uses useForm which I don't want to happen. Or for isolated render one should use useFormState?
@@grenadier4702 We started with Proxy, however it requires polyfill with react native and hence switched to Object.definedProperty, the intension and idea is the same which to detect object property read and start subscription.