The curly braces surrounding
target are for restructuring the
event object that is passed to the function. One of the properties on the event object is target, ie.
event.target. By restructuring the object we extract the target property for use with our function as the variable ‘target’.
As for the whitespace, it is just for readability.
For more info on destructuring, refer to the MDN page. Destructuring
- Is it expected that anyone working with React is familiar with the kind of code we’re seeing in these examples?