The user can search a Pokemon by name. If there is a match, they will see only that Pokemon. If not, there is a message letting them know there was no match.
Related Issue(s)
closes #31
Changes
Added addSearchTerm() to HomeView, which will update its searchTerm state based on the value of the text input when the user clicks the search button.
SearchBar is now a state-controlled form. The text input is now required and shows a message if left empty.
PokemonContainer now accepts searchTerm as props
Added useEffect() in PokemonContainer that listens for a change in searchTerm prop.
Will render a Pokemon component if there is a Pokemon with a matching name in pokeList state
Will let the user know if there are no matching Pokemon
Additional Notes
This meets MVP, but a very nice feature to add if time allows would be for the user to click a Clear button and see all the Pokemon again (created issue #35 for future feature)
Description
The user can search a Pokemon by name. If there is a match, they will see only that Pokemon. If not, there is a message letting them know there was no match.
Related Issue(s)
Changes
addSearchTerm()
toHomeView
, which will update itssearchTerm
state based on the value of the text input when the user clicks the search button.SearchBar
is now a state-controlled form. The text input is now required and shows a message if left empty.PokemonContainer
now acceptssearchTerm
as propsuseEffect()
inPokemonContainer
that listens for a change insearchTerm
prop.pokeList
stateAdditional Notes