CodeBlanks Logo Icon CodeBlanks

Summary - Dev tools

Combine Flipper, DevTools and console to write a debug session.

Summary - Dev tools

In this group you met five development tools. Flipper bundles network, layout and console in one window. React DevTools shows the component tree and props/state. Console prints values quickly.

Remote debug attaches to Chrome DevTools; the debugger keyword is a breakpoint. Performance monitor shows FPS and RAM live; it has JS and UI rows. These five tools support finding bugs and understanding performance in a real app. Using them together makes debugging fast and visual.

Practice Write a component for inspection

Write an App component to inspect with DevTools and console. Inside it have a console.log('App opened') call and a debugger keyword. The component returns null.

Starter code

App.js
// Write the App component
// Put console.log and a breakpoint inside
// Return null

Sample solution

App.js
function App() {
  console.log("App opened");
  debugger;
  return null;
}

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 To inspect the component tree?

App.js
npx ???
  • React DevTools Correct answer
  • Flipper
  • Performance monitor
  • Console

Explanation: React DevTools shows the component tree.

2 Match each tool to its purpose

Term Meaning
Flipper All in one window
React DevTools Component tree
console Quick value print
remote debug Chrome DevTools
perf monitor FPS and RAM

3 The React DevTools command

Question
$ ____ react-devtools
Answer
$ npx react-devtools

Explanation: npx react-devtools opens the standalone version.

All lessons in Intermediate