The InputCity Component

Learn how to use the component's input and button elements.

The InputCity.js component provides us with a search box. In it, we write the name of the city and add a “search” button to initiate an API call. Let’s begin by creating a search bar. Our InputCity component accepts the onSubmitHandler, city, and onInputHandler properties, which are passed once the InputCity component is imported into the App.js file. This can be observed in the following code:

const InputCity =
...