TypeScript types when creating your own UI components
So I have been trying to create some reusable UI components for a form similar to how the shadcn/ui form that is built on top of react-hook-form works. My attempt got added as an attachement but here are som snippets of the two components hardest to make work with TypeScript.
Form:
And FormField:
I dont really know where to go or how to approach this further. I have been debugging for hours, but getting TypeScript to be friendly with this library when creating my own components has been a curse. I appreciate any feedback and help!
With the current setup I am getting this error:
1. Type instantiation is excessively deep and possibly infinite. [2589]
0 Replies