Header Component

Add the header component and apply a style to it.

Add the Header component

The Header component displays the app’s name on the top of the screen. We’ll name our app “Pretty Sunny” and add the heading class. This class has the styling properties added to it in the styles.css file. We then import the Header component into the App.js file so that it can be displayed on the screen. The Header component is shown in the following snippet:

const Header = () => {
  return <div className="heading">Pretty Sunny</div>;

export default Header

We get the following widget by using the code provided above:

Get hands-on with 1200+ tech skills courses.