Validating form input
This does not mean React can be used to make a form secure.
Hackers can bypass your React form altogether, passing variables directly to the server.
You will still have to provide security and additional error-handling on the server side.
Using React for error-checking is mainly for making a form easier to use.
React allows you to easily display errors as the form is being filled so the user doesn’t have to fill in the entire form, press the submit button, then try to figure out what they got wrong.Now let’s dig into the code: Setting up for form submission The React DOM.render call at the bottom of the code is the first call that starts the app.We use XML-style JSX to call the Donation Box component.The best examples can be seen in the calls to the Text Input and Radios components.
As you can see, there are two calls to the Text Input component, but with different variables and validation functions included in the attributes (available as props in the child components).
The component itself doesn’t care what type of validation is going on.