Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If you want to write it to the DOM, pass a string instead: w="true" or w={value.toString()}

I got this error while rendering:

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()}.

When I remove the code below my code the error disappears:

<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>
like image 467
gy_79 Avatar asked Jan 31 '26 03:01

gy_79


2 Answers

There's a loose "w" floating around in one of your select options:

<option value=""w>Selectionner un type</option>

That's the culprit. It should be:

<option value="">Selectionner un type</option>
like image 139
Alexander van Oostenrijk Avatar answered Feb 03 '26 10:02

Alexander van Oostenrijk


I have only encountered this error when there is an unnecessary character mostly a typo in this case the unnecessary "w" and when I had my issue got this error

Warning: Received true for a non-boolean attribute c. If you want to write it to the DOM, pass a string instead: c="true" or c={value.toString()}. at form at div

meaning the undeclared "c" was inside a div in my form and is considered true though it's not a type boolean.

like image 22
Rhinolamer Avatar answered Feb 03 '26 11:02

Rhinolamer