We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1576c27 commit 0f70152Copy full SHA for 0f70152
packages/utils/src/getTemplate.ts
@@ -18,6 +18,10 @@ export default function getTemplate<
18
if (name === 'ButtonTemplates') {
19
return templates[name];
20
}
21
+ // Allow templates to be customized per-field by using string keys from the registry
22
+ if (Object.hasOwn(uiOptions, name) && Object.hasOwn(templates, uiOptions[name])) {
23
+ return templates[uiOptions[name]]
24
+ }
25
return (
26
// Evaluating uiOptions[name] results in TS2590: Expression produces a union type that is too complex to represent
27
// To avoid that, we cast uiOptions to `any` before accessing the name field
0 commit comments