1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Validate a Single React Input

    reactReact

    Learn to validate the presence of text in a single React input by displaying a green-check or a red-cross emoji next to it.

    We'll do this by creating a variable isValid that will return true if any text is found in the state property hooked up to the input field. This newly created variable will be used in a ternary to display the correct emoji mentioned above.