Grokking React Native
0% completed
Validating User Input
A form can reject a correct email address because of one space at its end. A simple pattern check rejects me@site.com with the space and accepts the same address once the space is removed. Checking the data that a user enters before your app uses it is called validation, and most of the work is deciding what to reject and how to tell the user.
Checking That a Field Is Not Empty
The simplest rule says that a required field must contain text. The sign-up form applies it when the user presses Submit, and it stores the message in state so that the screen can display it.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%