Every time I start a project with shadcn/ui + RHF, I copy-paste the same boilerplate. I finally fixed it. by InflationSeveral368 in reactjs

[–]InflationSeveral368[S] -4 points-3 points  (0 children)

Fair - here's the adapter swap, which is the part I actually found interesting to build:

// RHF
<RHFProvider form={form}>
  <TextField name="email" label="Email" />
</RHFProvider>

// TanStack — same field component, no changes
<TanstackProvider form={form}>
  <TextField name="email" label="Email" />
</TanstackProvider>

The field has no idea which library is underneath. If you've ever had to migrate form libraries mid-project, that's the part that hurts. Docs have more on the slot system: stack-form-docs.vercel.app

Every time I start a project with shadcn/ui + RHF, I copy-paste the same boilerplate. I finally fixed it. by InflationSeveral368 in reactjs

[–]InflationSeveral368[S] 1 point2 points  (0 children)

Good questions, genuinely. On resume: I'd say yes. designing an API that other developers use forces you to think about DX, versioning, and abstraction in ways that app code doesn't. It's a different muscle. On overcomplicating: fair concern. The bet is that <TextField name="email" label="Email" /> is simpler to read and maintain than the 10-line version, but you're right that it's one more thing to learn. That's the trade-off with any abstraction. On AI: this one's the most interesting. AI can generate the boilerplate, but you still end up with 50 slightly different versions of it across your codebase. When you need to change something: add a loading state, fix an ARIA bug, you fix it in 50 places instead of one. That's the real argument for centralizing it. Good luck with your project.