Input is a void element tag and must neither have children
nor use dangerouslySetInnerHTML
.
render() { let radioid = this.props.radioid; return ( <div className="row"> {this.props.options.map(function(option) { return ( <div key={radioid} className="column"> <input type="radio" name={radioid} value={option}> <label>{option}</label> </input> </div> ); })} </div> ); }
For example options is a list of elements like A, B, C, D
Most HTML elements have a start tag and an end tag that indicate where the element begins and where it ends. There is a group of elements that are exceptions to this rule. These elements are called empty or void and only have a start tag since they can't contain any content.
A void element is an element whose content model never allows it to have contents under any circumstances. Void elements can have attributes. The following is a complete list of the void elements in HTML : area , base , br , col , command , embed , hr , img , input , keygen , link , meta , param , source , track , wbr.
As per the error, the input tag should not have any children, take the label out of input closure tag
render() { let radioid = this.props.radioid; return ( <div className="row"> {this.props.options.map(function(option) { return ( <div key={radioid} className="column"> <label>{option}</label> <input type="radio" name={radioid} value={option}/> </div> ); })} </div> ); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With