State setters for newbie ...

Hi!
Again, this is taken from codecademys react intro course.
I have the same issue as usual – reading syntax.

This code snippet is simplified as follows:

const handleChange = (event) => {
    const newEmail = event.target.value;
    setEmail(newEmail);
}

const handleChange = (event) => setEmail(event.target.value);

const handleChange = ({ target }) => setEmail(target.value);


1. Why is there curly brackets around target in the last restructuring, but not around event in the second restructuring. What is the curly brackets doing ...?
2. What happened to event in the last restructuring?
Was this page helpful?