Why do we use round brackets here?

I was refreshing my react skills and there is one confusing thing…

...
//in constructor method is bound to this
  this.increment = this.increment.bind(this);
...
//method itself
  increment() {
    this.setState(state => ({
      count: state.count + 1
    }));

Now, here is my question:
Why do we use state=>({}) instead of state=>{}

I tried to find some examples in mdn docs, but no info.

From Arrow function expressions - JavaScript | MDN

This is because the code inside braces ({}) is parsed as a sequence of statements (i.e. foo is treated like a label, not a key in an object literal).
You must wrap the object literal in parentheses

3 Likes

Ah, I am ashamed that I missed that. Thanks.