Creating Function-Based Components
Learn about the function-based components for the header of our app.
In this section, we are going to start by creating a component for the header of our app, which will contain our app name and the ability to search for questions. Then, we’ll implement some components so that we can start to build the home page of the app, along with some mock data.
Creating a Header component
We can create a basic Header
component and reference it within our App
component by carrying out the following steps:
Create a new file called
Header.tsx
in the “src” folder.Import React into the file with the following import statement:
Access this course and 1400+ top-rated courses and projects.