React setState not Updating Immediately
I'm working on a todo application. This is a very simplified version of the offending code. I have a checkbox: <p><input type="checkbox" name="area" checked={this.state.Pencil} onChange={this.checkPencil}/> Writing Item </p> Here's the function that calls the checkbox: checkPencil(){ this.setState({ pencil:!this.state.pencil, }); this.props.updateItem(this.state); } updateItem is a function that's mapped to dispatch to redux function mapDispatchToProps(dispatch){ return bindActionCreators({ updateItem}, dispatch); } My problem is that when I call the updateItem action and console.log the state