1. 2
    Validate a Single React Input
    58s

Validate a Single React Input

InstructorGosha Arinich

Share this video with your friends

Send Tweet

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.

Srinivas Kasiriveni
~ 6 years ago

How are you embedded to emoji ?

Gosha Arinichinstructor
~ 6 years ago

How are you embedded to emoji ?

The shortcut is cmd-ctrl-space on Mac