update data via react-hook-form
Hi,
I’m trying to create some type of update functionality to my website using forms. Basically the idea is to fetch from the database and offer the user the possibility to change the details of each field as well as adding/removing fields. You can think of a structure similar to a résumé builder. Is react-hook-form the correct technology for that? Or should I consider something else?
6 Replies
I just HTML
<form>
unless I really need to use react-hook-formWhat would be the use case of react-hook-form for yourself perspective?
I use
<form>
a lot; never had to use any libraries. But:
* if state variables in the form cause too many re-renders, I'd use react-hook-form
* if I need validation, I'd use Zod
just because I already have it installed with T3
but if you have too many state variables in your form, I'd start by trying to remove them or at least replace them with refsOh also this may help: https://youtu.be/m0hb8FfAUfc
Web Dev Cody
YouTube
What is my favorite way to handle forms in React?
🤖 SaaS I'm Building: https://www.icongeneratorai.com/
💬 Discord: https://discord.gg/4kGbBaa
🔔 Newsletter: https://newsletter.webdevcody.com/
📁 GitHub: https://github.com/webdevcody
📺 Twitch: https://www.twitch.tv/webdevcody
🤖 Website: https://webdevcody.com
🐦 Twitter: https://twitter.com/webdevcody
I create a separate form component for editing existing data and then pass the data as default values
Thanks @100xdev @DollaHane 23033
I really appreciate your input