Filter a List

Write the code, see it run, pass the checks.

The problem

  • easy
  • Code

Add a search box labelled "Search" above the list of fruits. Show only the fruits whose name contains what's typed, ignoring upper and lower case, and show "No matches" when nothing matches. Tip: work out the visible fruits from the search text while rendering, rather than keeping a second, filtered copy in state.

Your code must pass

  • Shows every fruit at first
  • Typing ap shows Apple, Apricot and Grape
  • Ignores upper and lower case
  • Shows "No matches" when nothing matches