I have being thinking on how to improve my components, and i think using the useFormContext inside each component is a better approach then passing the control or register as a param. Also, i like to create the content of my form without having the wrapping it. I will only wrap the component with the form when i am using it. Therefore, i can use the same form for creation and edition of a content, and have the power to control anything i need using the formMethods from useForm()... Ex: const Input = ({ name, label, ...props }) => { const { register, formState: { errors } } = useFormContext() const error = errors[name]?.message return {label && {label}} {error && {error}} } const SignInForm = () => { const { formState: { isSubmitting } } = useFormContext() return sign in } const SignInPage = () => { const formMethods = useForm({ resolver: zodResolver(schema) }) return }
Awesome video, like the quality improvements. The animations and the background music are great. Also, I like how you make simple explanation on what forms are. I think it’s very useful to get attention of people who not that familiar with web development and just want to watch some random tech video like I do 😂 In my opinion the quality of the production is crucial for the videos like this. So I would continue with this approach because from my perspective it will increase the amount of viewers. But that’s just my opinion. All in all the only thing that’s really matters is how you enjoy it. If you think that keeping this production quality is too tedious and may affect your performance than it definitely not worth it or maybe you should hire someone to do that work for you. Any ways great job 👍🏻
Thanks a lot for the feedback!! Really appreciate it! Yeah.. I shared it in some other places, and I’m getting great feedback on this one. It does take longer to release, which results in less consistent uploads. But maybe it’s worth it. I’ll try to put more of these in the future as well! Thanks again!! ☺️