score:0

Accepted answer

easy and fast fix could be remove the "value" sync and the state will update just fine.

<input type="text" name="newitem" placeholder="enter an item" onchange={this.handlechange} />

i pointed out the real problem. in "shouldcomponentupdate", if you return "false" for any reason, component in not update with state. this method should be used carefully as it can break your app. remove the method or return true and component will work just fine.


Related Query

More Query from same tag