r/reactjs • • 9d ago

Discussion Adapter over React hook forms

Those of you that use a form library in your react codebase. Do you tend to create an adapter over it or just use it directly? The reason I am asking is because I want to protect our codebase in case we need to shift to a different library at some point. It’s much easier to update the adapter in this case than it is to adjust the whole codebase (even with agents).

1 Upvotes

13 comments sorted by

View all comments

1

u/allaboutzaid 8d ago

As someone still learning React and building small sites, I would not add the adapter yet. For my portfolio and a small clothing-brand site, using React Hook Form directly kept things simple, and the field components and Zod schema are the parts I would actually reuse if I ever switched libraries. Your reason makes sense for a bigger codebase that might change libraries, but on a small project the extra layer feels like more to maintain than the swap it is protecting against.