AI Hints
Home›React Tutorial›Debugging and the Project Plan
React · Lesson 88 of 120

Debugging

React DevTools.

⏱ 2 min read▶ Video at 1:14:57🎓 Free
Watch this lesson in the React courseWatch on YouTube ↗Full React course

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.

keyvalue
Treeevery component
Inspectprops, state, hooks
Editvalues live
Findwho 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.

  1. Read the error
  2. Find component
  3. Check props, state
  4. Log
  5. 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