Skip to content
Guest
Learn React · Course Syllabus Show lessons
React Core · 8 min read · Intermediate

Lists, Keys & Conditional Rendering

Render arrays cleanly with .map(), assign stable unique key props, and derive filtered views without redundant state.

What you'll learn

  • Render dynamic lists using array.map() and stable IDs as keys
  • Understand why array index keys cause bugs when lists are reordered or filtered
  • Compute derived values directly during render instead of duplicating state

When rendering lists in React (items.map(item => <Row key={item.id} ... />)), the key prop lets React match each item across renders so inputs, animations, and local state stay attached to the right row.

Fill-in-the-Blank Exercise

Keyed List Rendering

Map over courses and pass course.slug as the stable key.

{courses.((c) => (
<li ={c.slug}>{c.title}</li>
))}

Live Derived List Demo

JSXLive Keyed List & Derived Filter (JSX)
Live React Preview

Check Your Understanding

Score: 0 / 1

1. Should a filtered list (derived from items + searchQuery) be stored in a separate useState?

Study Workspace

Finished this lesson?

Your progress is saved locally in your browser, no account needed.

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind