Selecting React elements

There are actually two ways to select a React element using React Developer tools. When you open the React section of the developer tools pane, the root element of the React app is automatically selected in the element tree. However, you can expand this element to reveal child elements and select them.

Let's put together a simple app that will help you explore the rendered React elements on the page using React Developer Tools. Starting from the top level, here's the App component:

import React from 'react'; 
import MyContainer from './MyContainer'; 
import MyChild from './MyChild'; 
 
const App = () => ( 
  <MyContainer>
    <MyChild>child text</MyChild> 
  </MyContainer> 
); 
 
export default App; 

By looking at this source, you ...

Get React 16 Tooling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.