You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot embed bare do block in FormGroup component #11
<FormGroup><Label>Email</Label><Inputname="email"onChange={this._handleChange}/>{do{if(this.state.showEmailEmpty){<span><br/>This field cannot be empty
</span>;}}}</FormGroup>
fails with this error:
Moving the <span> tag outside of the do block solves the issue...:
<FormGroup><Label>Email</Label><Inputname="email"onChange={this._handleChange}/><span>{do{if(this.state.showEmailEmpty){"This field cannot be empty"}}}</span></FormGroup>
Then it might be due to the fact that the FormGroup component maps React component children, and since the {do} block isn't a component it is failing. You could also try this https://github.com/Drawbotics/if-only to do the same thing but for simple If statements
Activity
nicmosc commentedon Jan 31, 2018
I see a semicolon after the closing span, that could be causing the issue
LeopoldArkham commentedon Jan 31, 2018
Same result for me without semicolon
nicmosc commentedon Jan 31, 2018
Then it might be due to the fact that the
FormGroupcomponent maps React component children, and since the{do}block isn't a component it is failing. You could also try this https://github.com/Drawbotics/if-only to do the same thing but for simple If statements