Command Palette

Search for a command to run...

Hectal
Phase 27: Capstone: Build a Complete App
React · Exercise 4 of 6 PreviousNext
Advanced

Milestone 4: filters and search in the URL

Keep the search text and the priority filter in the URL with useSearchParams() from react-router, and show only matching tasks.

input#search sets q (remove q when the box is empty). select#priority sets priority (remove it for all). Use { replace: true }.

Board shows only tasks whose title contains q (ignoring case) and whose priority matches. <output id="url"> already shows the current URL.

What Check tests

  1. Typing re puts q=re in the URL
  2. Only titles containing re are shown
  3. Choosing high adds priority=high and filters
  4. Clearing the search removes q
  5. Choosing all removes priority and shows every task

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.