form field fixes

This commit is contained in:
2026-06-05 17:05:23 +05:30
parent a51fb62fd7
commit 1ab97fc0e4
3 changed files with 18 additions and 10 deletions

View File

@@ -10,12 +10,12 @@ import GenericForm from "../components/GenericForm";
function wrapFormField(merged: FieldComponents) {
return (props: Omit<React.ComponentProps<typeof FormField>, 'components'>) =>
<FormField {...props} components={merged} />;
React.createElement(FormField, { ...props, components: merged });
}
function wrapGenericForm(merged: FieldComponents) {
return (props: Omit<React.ComponentProps<typeof GenericForm>, 'fieldComponents'>) =>
<GenericForm {...props} fieldComponents={merged} />;
React.createElement(GenericForm, { ...props, fieldComponents: merged });
}
export function useResource<T = any>(config: ResourceConfig | undefined, options?: { fieldComponents: FieldComponents }) {