Course lesson

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

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...

Duration
2 min
Access
Free
Transcript
Available

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.