Local State Exercise

Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.

1

Exercise 1 of 1

Colocate Form State

Draft state in the root causes NoteList to flash on every keystroke — move it into CreateNote.

App — draft state at root

CreateNote renders: 1

NoteList renders: 1

  • Meeting at 3pm
  • Buy groceries
  • Call dentist

Type in the input. NoteList flashes on every keystroke — it re-renders because App re-renders, even though NoteList doesn't use draft at all.

Practice: Local State Exercise — Interactive Exercises | Durgesh Rai