Routing and State Exercise

Build a small notes dashboard with routes.

This tests React Router, params, layout routes, and state placement.

Requirements

Routes:

/notes
/notes/:noteId
/settings

The app should:

Component structure

App
NotesLayout
NotesList
NoteDetails
Settings
NotFound

Route params

function NoteDetails() {
  const { noteId } = useParams()
  // load or find note by noteId
}

What to practice

Interview angle

Explain that route state belongs in the URL when users should be able to refresh, share, or bookmark it. Temporary UI state can stay inside React component state.