/React-Challenge-4

Created with CodeSandbox

Primary LanguageJavaScript

Welcome to the fourth mini challenge!

In this Codesandbox, you have a complete environment with all you need to run your app. You just have to follow the instructions below:

  1. Modify PokeNameValidator component to display a random Pokémon name from the array in pokemons.js file. The random Pokémon name should be displayed after the text "Pokémon name:"
  2. Create the logic to store and update the input data in the component state. Hint: this value should be updated every time that the user presses a key inside the text input field.
  3. Create the logic to compare each updated value with the random Pokémon name computed. When the valued typed in matches the random Pokémon name, you should trigger an alert window in the browser with a message that says: "Correct! Play again?"
  4. Bonus: After the alert window is closed, you should clear the value for the text input and compute a new random Pokémon name so the user can play again.

Expected result: Please check: poke-name-validator.gif

Note: If you're not familiar with functional components on React, don't worry, you can modify PokeNameValidator to be a class component, it's up to you.