Hands down console.log() was, is and will always be the greatest debugging tool of all time.

React team launched a new version of the React Dev Tools (v4) a few weeks ago and it’s fantabulous. It gives you debugging superpowers to navigate through your tree, trace data flow, spot weak links and optimise for perf.

There are two separate tabs (Components, Profiler) now as opposed to the old version which had only one React tab.

New Dev Tools has great many improvements over the old version. To highlight a few —

🏎 Faster

🎣 Hooks support

🧐 Advanced tree filter

🤠 Better search UX

👮‍♀️ Badges for HOCs

🎯 Remembers selection after page reload

Top 10 Features

Dev Tools can do a lot of things. We’re are not going to dive into the nitty gritty details of each and every feature. Instead we’ll take a look at the top 10 helpful features that help us save time and write better React code.

Components Tab

Live edit state/props Search through tree Advanced tree filter Rendered by Owners tree Quick Navigation Utils

Profiler Tab

Profile initial mount Why did this render? Rendered at

1. Live Edit State/Props

You can live edit the state and props of a component and instantly see the results in the page.

2. Search Through Tree

The search bar comes handy when you want to quickly find and jump to a component in the tree. Now that the Dev Tools can remember stuff the selected node is saved between reloads and you don’t have to repeat the action every time you reload the page.

3. Component Filter

Filter is a powerful feature to reduce visual noise and focus on what matters at the moment in a huge tree. You can filter with a variety of options like context, HOCs, host(DOM) nodes, component name, etc.

4. Rendered By

Rendered By is a list of owner/parent components that rendered the selected component. You can quickly jump to a parent component by selecting an entry from the list.

5. Owners Tree

Owners Tree gives you an eagle eye view of a particular component and its sub-tree and hides the rest of the component tree.

To enter into owners tree view, you have to double click a component in the tree.

6. Quick Navigation

Switching between Elements tab (browser dev tools) and Components tab (react dev tools) is pretty easy and the corresponding node is auto selected in these tabs.

To find the corresponding DOM node in the Elements tab, select the component and click the small eye icon on the right pane. It will take you to the Elements tab with the corresponding DOM node selected.

To find the corresponding React node from Elements tab, just select a node in Elements tab and click the Components tab. React Dev Tools will automatically select the corresponding component.

7. Utils

Components tab offers three small handy utils.

Suspend component Inspect matching DOM element Log component data to console

Suspend Component

You can easily switch between the waiting(loading) and resolved states of Suspense components.

Inspect matching DOM element

We already saw this in Quick Navigation. You can select a component and click the eye icon on the right pane to jump to its corresponding node in Elements tab to inspect it.

Log component data to console

This is a handy utility that logs the entire component meta data to the console. The log gives details like props, hooks, corresponding DOM nodes and the component file location in the file system.

To log component data to console, select the component and click the small bug icon in the right pane.