Loading …
In this lesson, we'll learn how to add a 'loading' message to our application while results are being fetched.
Displaying a Loading message
Now we get back to the application, where we’ll show a loading indicator when a search request submits to the Hacker News API. The request is asynchronous, so you should show your user feedback that something is happening.
Defining the Loading component and state property
Let’s define a reusable Loading component in the src/App.js file like in the following.
Get hands-on with 1400+ tech skills courses.