Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js warning #9

Closed
ryuken opened this issue Apr 24, 2016 · 1 comment
Closed

js warning #9

ryuken opened this issue Apr 24, 2016 · 1 comment

Comments

@ryuken
Copy link

ryuken commented Apr 24, 2016

warning.js:44 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of FlatField. See https://fb.me/react-warning-keys for more information.

My schema:

FormGenerator.create({
                    stringField: {
                      type: String,
                      className: "form-control",
                      label: 'String Field',
                      defaultValue: 'Welp',
                      validators: [
                          FormGenerator.validators.minLength(1),
                          FormGenerator.validators.maxLength(10),
                          function(val) {
                            if (val.toLowerCase().indexOf('welp') === -1) {
                              return 'Error: input must contain "welp"';
                            }
                          }
                      ],
                      isRequired: true
                    },
                }, 'form', this.onSubmit)

The fix is to add key: name in the flat field generation parts for textfield, select, etc..

@SteveVitali
Copy link
Owner

My bad -- should be all fixed in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants