You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This not only allows you to reuse the UI of your shared component, but retains the type-safety you'd expect from TanStack Form: Mistyping `name` will result in a TypeScript error.
111
+
This not only allows you to reuse the UI of your shared component, but retains the type-safety you'd expect from TanStack Form: Mistyping `firstName` will result in a TypeScript error.
107
112
108
113
#### A note on performance
109
114
@@ -160,6 +165,71 @@ function App() {
160
165
}
161
166
```
162
167
168
+
### Extending custom appForm
169
+
170
+
It is quite common for platform teams to ship pre built appForms. It can be exported from a library in a monorepo or as a standalone package on npm.
// Ts will error since the parent appForm already has a component called CustomSubmit
227
+
formComponents: { SubmitButton },
228
+
})
229
+
```
230
+
231
+
This way you can add extra fields that are unique to your team without bloating the upstream AppForm.
232
+
163
233
## Breaking big forms into smaller pieces
164
234
165
235
Sometimes forms get very large; it's just how it goes sometimes. While TanStack Form supports large forms well, it's never fun to work with hundreds or thousands of lines of code in single files.
@@ -218,6 +288,9 @@ function App() {
218
288
}
219
289
```
220
290
291
+
> Something worth mentioning, is that while multiple chaining of `AppForm` extensions is possible it is can lead to decreases in TypeScript performance.
292
+
> For most users that may only extend an appForm once this isn't a problem, however we recommend limiting it to 3-5 extensions.
0 commit comments