Fantastic video! It helped me understand what I was missing in my code. However, I would like to integrate with the "freeSolo" prop of Autocomplete, any ideas on how to do that?
I was all in until we got to error checking. Wow, useImperativeHook seems super unintuitive to me and something I'd not want to have to explain in a code review. I was following along great until then.
amazing video, I just don’t understand why you reassign the “setErrorRef.current = setError”. Isn’t it just enough to assign it once as: const setErrorRef = useRef(setError) This should already point the current value of serErrorRef to the setError function. Hence, “setErrorRef.current = setError” should not be necessary.
Fantastic job. I'm having trouble using this with 'multiple' however. Also, and edit mode would be super helpful, so we can see how to preselect an option based on a value that would have been retrieved from the backend/db
Nope, did not play around with server components enough yet. I have a hunch that the server components pattern will change a bit in the next year, so I'm not sure it's worth the effort to create another set of videos now 🤔
That would be quite a long explanation unfortunately, but you can give it a try by starting to check the docs on MUI on how to enable multiple selection, then following the trail of changes, starting with the onChange handler in our code, then going all the way to the validation schema if any. 👍
Man I've never seen someone so dedicated to covering everything related to react forms. Very interesting approach to keep the form data just in memory for local development, didn't know that was possible! I think react-query would've been a great fit for this video as there's a lot of data fetching going on, but you managed to do everything with the regular fetch. Kudos, thanks a lot for sharing
Thanks Josh. I tend to keep my data in architectural layers that I control completely. I usually work with more complex data fetching systems that require more than just push and pull via http. I covered forms a lot because it reduces the time I need to spend explaining things one on one during code reviews. Going to move on to something else 😅
Thanks for taking your time to build that form and record a tutorial on how to do it. Sometimes, forms can be tricky especially when you have to build them with "dynamic" content based on what the user does in that form. Also, maybe tell chatGPT next time that he's on camera so he can behave and write the exact code that you want 🤣