Skip to content

ListAddField not rending child fields. #1228

Answered by radekmie
ApoorvSeth asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ApoorvSeth. It's because you've nested the fields inside the ListAddField and not ListField itself. Try this instead:

      <AutoForm schema={schema} onSubmit={(e) => handleSubmit(e)}>
        <h4> Add a Project</h4>
        <AutoField name="projectName" />
        <AutoField name="groupName" />
        <ListField name="names">
          <ListItemField name="$">
            <TextField name="firstName" />
            <TextField name="lastName" />
          </ListItemField>
        </ListField>
        <SubmitField />
      </AutoForm>

In such a setup:

  • The ListField copies the ListItemField once for each list element and renders a ListAddField.
  • The ListItemField is used as a container and

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by radekmie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants