O'Reilly logo

React 16 Tooling by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hot component reloading in action

Earlier in this chapter, you learned how to start the react-scripts development server. This development server has hot module reloading configured and ready to use. All you have to do is start writing component code.

Let's start by implementing the following heading component:

import React from 'react'; 
 
const Heading = ({ children }) => ( 
  <h1>{children}</h1> 
); 
 
export default Heading; 

This component will render any child text as an <h1> tag. Easy enough? Now, let's change the App component to use Heading:

import React, { Component } from 'react'; import './App.css'; import Heading from './Heading'; class App extends Component { render() { return ( <div className="App"> <Heading> My App </Heading> </div> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required