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
TypeError: Invalid attempt to destructure non-iterable instance #27
Comments
Yes, I can see why this is confusing. This doesn't work Should add a default for initialState, to fall back to an empty object. |
I think there are two reasons why this is confusing: 2.) The examples initialize the state with |
Actually, I made a mistake in my original issue. The value I am passing is, <SimpleForm
onSubmit={this.onSubmit}
initialState={this.state.form}
rules={validationRules}
instantValidation={true}
validateSingle={true}
/>
No, same error |
The rules object is is the problem: |
Told you it was my mistake, thanks man! |
Again, I think a guard clause here could be nice. Flow and TS definitions will also help avoid this error. In the meantime, I hope people with the same problem can easily find this issue! |
Yes, good point. We'll add some dev logging mechanism and sane defaults. Regarding TS and Flow, yes - let's add them. |
Sorry, I am sure this is my mistake, but hopefully you can help anyway
I have a simple form,
Which I then reference from my app,
When I pass
initialState={}
, I get this error in the console as soon as I type:If I pass
initialState={ form: { name: 'Alex' } }
, I see that same error immediately, in the browser:Link: https://www.dropbox.com/s/22exefba9wzuemm/Screenshot%202017-06-26%2012.28.29.png?dl=0
Any idea what could be happening here?
The text was updated successfully, but these errors were encountered: