Use InputCity Component
Learn how to call an API using a dynamic value.
We'll cover the following...
We’ll now pass the values into the onSubmitHandler
, city
, and onInputHandler
props that we used in the InputCity
component in the previous lesson.
Add the city
prop
The city
prop stores the city
value given by the user. We’ll do this by using the useState
hook. The snippet below demonstrates how to add the city prop.
const [inputCity, setInputCity] =
...