React · Lesson 88 of 120
Debugging
React DevTools.
When something looks wrong, the question is usually simple. What are the props and state right now? React DevTools shows you exactly that, for every component.
- Something's wrong
- What are props and state?
- DevTools shows you
The components tab
The components tab shows your component tree. Select one, and see its props, state, and hooks, live. You can even edit values, and watch the page update. And it tells you which component rendered it.
| key | value |
|---|---|
| Tree | every component |
| Inspect | props, state, hooks |
| Edit | values live |
| Find | who rendered it |
A debugging routine
Read the error message carefully. Find the component in DevTools. Check its props and state. Add a console log if you need more. Then fix, and check again.
- Read the error
- Find component
- Check props, state
- Log
- Fix
Summary
Read errors, then inspect props and state in React DevTools. Next, the ecosystem quiz.
Key takeaways- Components tab
- Props and state
- Edit live
Next up: Ecosystem Quiz — test yourself