Table of Contents

About

A React form 1) is the implementation of HTML form elements with HTML React elements

It works a little bit differently from other DOM elements in React, because form elements naturally keep some internal state.

State controller

In React, there are 2 ways to create and manipulate the value of the forms. If the value is controlled:

Controlled Component

A controlled component is a form where the values are controlled by React.

The react html components:

All accept a value attribute that is used to implement a controlled component.

Uncontrolled component

An uncontrolled component is a React form where the values are stored in the value property of the HTML form control element (input, text area, select, …))

React Control Element

React wraps form control element.

See the following control element in React.

Library

Library try to help:

  • Getting values in and out of form state
  • Validation and error messages
  • Handling form submission

List: