How do I call setState with the previous state plus an additional value in a controlled component?
The typical example is:
Increment() {
this.setState((prevState, props) => ({counter: prevState.counter = props.step})
}
However, how do you update the state based on the prevState and a value from a handler. For example (and I know this example is wrong, since you cannot pass value into the setState callback):
HandleOnAddItem(evt, { value }) {
this.setState((prevState, props, value) -> ({items: value, ...prevState.items})
}