I've got an internal component library that I would like to provide a base of the most common components needed for a form; e.g. TextField, SelectField, DateField, etc. I was initially thinking to register those components and have the consuming app inherit them while also being able to create their own fields that aren't covered within that set and register as well. A common use case in the past would be async fields that fetch information specific to that application but maybe it's as simple as just extracting that data layer from the presentational layer. Screenshots linked showcase this scenario where common components are provided via the component library and the following
createFormHook
createFormHook
build upon those with an app specific
ContactSelectField
ContactSelectField
.
I couldn't find any information or examples around this sort of "inheritance of registered components". Maybe that's due to this approach and the community as a whole not seeing a reason to do something like this. I also couldn't find anything about the
fieldContext
fieldContext
and
formContext
formContext
options in
createFormHook
createFormHook
. Is there a reason to ever override these options?
Would love to hear how y'all are managing any sort of unique field/form components with Tanstack Form, thanks!