Here we are creating functional component in the Header.js file in place of class component
The reason is that functional components acts as dumb components. So when it is needed just to display something on page than functional component is used.
Class component has lifecycle method attached to them. So when you need access to life cycle method or state than class components are used.
https://medium.com/quick-code/lets-learn-react-chapter-4-functional-x-class-based-component-227f89ea2192
1