我在渲染时遇到这个错误:
Warning: Received 'true' for a non-boolean attribute 'w'. If you want to write it to the DOM, pass a string instead: w="true" or w={value.toString()}.
当我删除代码下方的代码时,错误消失了:
<div className="form-group">
<div className="col-12">
<label htmlFor="inputConfirmType">Type de confirmation</label>
<select id="inputConfirmType" name="confirmType" className="form-control" onChange={this.handleInputChange} required>
<option value=""w>Selectionner un type</option>
<option value="Ecole">Ecole</option>
<option value="Professeur">Professeur</option>
<option value="Inspecteur">Inspecteur</option>
</select>
</div>
</div>
最佳答案
在您选择的选项之一中有一个松散的“w” float :
<option value=""w>Selectionner un type</option>
这就是罪魁祸首。应该是:
<option value="">Selectionner un type</option>
关于reactjs - 如果你想将它写入 DOM,传递一个字符串而不是 : w ="true" or w={value. toString()},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59437604/