r/reactjs • u/salamazmlekom • 6d 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).
2
Upvotes
View all comments
2
u/acraswell 6d ago
An adapter around what? The library or the input components? Because I always build wrappers around the input components and it greatly reduces the amount of code or smaller bugs from inconsistent use of the form library. But it has very little to do with changing the forms library later. It does help, it just isn't the primary motivation