lundi 10 juin 2019

Problems creating Checkbox with react

I'm actually trying to create a checkbox with with react and i've tryied it a lot of ways and everytime it show me the same output: the label of the checkbox at a transparent color that stays always at the left top side of the web page:

enter image description here

the code that creates it:

<div>
   <input type="checkbox" checked={this.state.checked} onChange={this.handleCheckClick}  id="filled-in-box"/>
   <label htmlFor="filled-in-box">Tomate</label>
</div>

handleCheckClick = () => {
    this.setState({ checked: !this.state.checked });
  }

There's not even a sign of the checkbox




Aucun commentaire:

Enregistrer un commentaire