I'm having a frustrating problem trying to toggle checkboxes in React.

When I check the box, the state updates, and the state, previous state, and checked display `true` when I `console.log` them, which is weird in itself. But the checkbox doesn't check.

**State**

```
    this.state = {
        type: {
            prop1: false,
            prop2: false
        }
    }

```

**Handling event change**

```
handleCheckbox(e) {
    const name = e.target.name;
    const checked = e.target.checked;
    this.setState((prevState) => {
        this.state.type[name] = !prevState.type[name];
    });
}

```

**Checkbox**

```
<input
   type="checkbox"
   name="prop1"
   id="string"
   className="modal__checkbox-input"
   checked={this.state.type.prop1}
   onChange={this.handleCheckbox}
/>

```