Tell us what’s happening:
Hi guys,
Quick question why in this case we need to write count: state.count+1
and not just count: count+1
?
Your code so far
// change code below this line
increment() {
this.setState(state => ({
count: state.count + 1
}));
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0
.
Challenge: Write a Simple Counter
Link to the challenge: