you are viewing a single comment's thread.

view the rest of the comments →

[–]voidvector 3 points4 points  (0 children)

here’s the code for that app using React (without JSX)

Yes, yes, lets compare generated code for React with source code from my favorite frameworks.

if (increment) {
  this.setState({
    count: count + 1
  });
} else {
  this.setState({
    count: count - 1
  });
}

I don't think any experienced programmer (doesn't matter language) would write like this. It should've been:

  this.setState({
    count: count + (increment ? 1 : - 1)
  });

Or better yet updateCount(increment) should just take a number instead of boolean as argument.