Create a new React App using create-react-app
: https://create-react-app.dev/
-
Copy the
fakeAPI.js
to the App created inTask 1
, it will be representing the API you will need to use in order to get the data required for this current task. -
Create a Page that must to contain an
input field
and abutton
. -
When the user types a string in the
input field
and click in thebutton
the component must to trigger a call for thegetStates
function, from thefakeAPI.js
included in this gist, thegetStates
function will return a promisse with a list of Mexico states. You must to filter the results and display it in a list.
- You should filter the results to only include the states that match entire or partially the string from the
input field
- You should handle Upercase and Lowercase strings either
- With these filtered results, you should display the states filtered in a list bellow the
input field
andbutton
- Notice, the
getStates
is intended to simulate and API call, so it will wait 2 seconds to return the promisse with the states, you should handle thisloading
state displaying a LOADING message or spinner. - You should apply CSS Styles, or use an UI library of your choise, in order to make the App Looks nice.
- You can build this structure with as many components as you think is required.
- Bonus Point to use
React Hooks
(but it is not required, you can use Class Components as well), it is better to complete the feature.
You are free to search in the web for any question you have, we are interested in seeing how you solve problems, and not if you remember every command in Javascript.
Feel free for ask as many questions as you think you need to undertand and finish the feature.