Debugging Common React Errors
Diagnose key-missing warnings, undefined state bugs, and hydration errors.
Welcome
In this lesson you will diagnose the most common React errors: missing-key warnings, undefined state bugs, too many re-renders, and hydration mismatches.
Missing Key Warning
React logs: *Each child in a list should have a unique "key" prop.* This happens when you render an array without adding a `key` prop. Fix it by adding a stable, unique key to each list item.
// Bad
items.map(item => <li>{item.name}</li>)
// Good
items.map(item => <li key={item.id}>{item.name}</li>)All lessons in this course
- Installing & Opening React DevTools
- Inspecting Component Trees & Props
- Using the Profiler Tab
- Debugging Common React Errors