Update state in React with the update function provided by the `useState` hook

Share this video with your friends

Send Tweet

In this lesson, we implement a "shortlisting" functionality to allow users to click on a name to add it to their shortlist. We use the useState hook to maintain that shortlist, and use the update function it provides to amend the list when a user clicks on a name.