-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
Prerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
Description
Currently custom ArrayTemplateField and ObjectTemplateField components must be set via a function
reference. This means you cannot use them in plain JSON.
Expected behavior
I'd like to register these like I do custom widgets/fields.
const table = (props) => { ...a component that renders a <table> with rows... };
const templateFields = { table };
const uiSchema = {
"ui:ArrayTemplateField": "table"
}
render((
<Form
schema={schema}
uiSchema={uiSchema}
templateFields={templateFields} />
), document.getElementById("app"));
Actual behavior
Not possible, you must do this:
const table = (props) => { ...a component that renders a <table> with rows... };
const uiSchema = {
"ui:ArrayFieldTemplate": table // HAVE TO USE FUNCTION REFERENCE
}
render((
<Form
schema={schema}
uiSchema={uiSchema} />
), document.getElementById("app"));
Version
1.8.0