I'm trying to get around the way to check if a checkbox is checked inside on a React.js component, and then store that in a Firebase Realtime database.

Right now, my checkbox works fine after 3 clics. I `console.log(this.state.isChecked);` and the first 2 clicks return "false" in my console, i can't understand why... Then after that if i continue clicking it works fine and alternate `true` and `false`.

Here is my code :

```
import React, { Component } from 'react';
import Popup from './Popup';

class PostPopup extends Component {
  constructor() {
    super();
    this.state = {
      isChecked: false,
    };

    this.handleCheck = this.handleCheck.bind(this);
  }

  (...)

  handleCheck = (event) => {
    const target = event.target;
    const value = target.value;

    if (target.checked) {
      this.setState({ isChecked: false });
      console.log(this.state.isChecked);
    } else {
      this.setState({ isChecked: true });
      console.log(this.state.isChecked);
    }
  };

  render() {
    return (
      <Popup {...this.props} style="post-popup">
        <header>Post a new product</header>
        <section>
                <form>

            (...)

            <div className="form-check">
              <input
                className="form-check-input"
                type="checkbox"
                value=""
                id="checkRaffle"
                ref="checkRaffle"
                onChange={this.handleCheck}
              ></input>
              <label className="form-check-label" htmlFor="checkRaffle">
                Lorem ipsum
              </label>
            </div>

            (...)

            <button type="submit" className="btn btn-primary" onClick={this.handlePost}>
              Envoyer
            </button>
          </form>
        </section>
      </Popup>
    );
  }
}

export default PostPopup;

```