React - Use State to Toggle an Element (When to add extra parenthesis to a setState() function?)

() => {
  foo: 'bar'
}

Fun fact, in that code foo: is interpreted as a labeled statement. As also explained in the MDN link.

1 Like