Forms in React

https://leanpub.com/code-react-sweetly

Types of Fields in React Forms

https://leanpub.com/code-react-sweetly

What is a controlled form field in React?

https://leanpub.com/code-react-sweetly

What is an uncontrolled form field in React?

https://leanpub.com/code-react-sweetly

Use the useRef Hook to access uncontrolled form values

https://leanpub.com/code-react-sweetly

Use the FormData Web API to access uncontrolled form values

https://leanpub.com/code-react-sweetly

Use the action form prop to access uncontrolled form values

https://leanpub.com/code-react-sweetly

action=URL: Handling form submission with a URL

https://leanpub.com/code-react-sweetly

action={function () { ... }}: Handling form submission with a client function

https://leanpub.com/code-react-sweetly

action={async function () { "use server" }}: Handling form submission with a server function

https://leanpub.com/code-react-sweetly

What to know about the action prop

https://leanpub.com/code-react-sweetly
value prop is valid for hidden fields
https://leanpub.com/code-react-sweetly
You can pass arguments to the action handler
https://leanpub.com/code-react-sweetly
Progressive enhancement of the form component
https://leanpub.com/code-react-sweetly

Use the formAction button prop to access an uncontrolled form value

https://leanpub.com/code-react-sweetly

formAction=URL: Handling form submission with a URL

https://leanpub.com/code-react-sweetly

formAction={function () { ... }}: Handling form submission with a client function

https://leanpub.com/code-react-sweetly

formAction={async function () { "use server" }}: Handling form submission with a server function

https://leanpub.com/code-react-sweetly

What to know about the formAction prop

https://leanpub.com/code-react-sweetly
value prop is valid for hidden fields
https://leanpub.com/code-react-sweetly
You can pass arguments to the action handler
https://leanpub.com/code-react-sweetly
Progressive enhancement of the form component
https://leanpub.com/code-react-sweetly
Creating multiple types of submission buttons
https://leanpub.com/code-react-sweetly

Important Things to Know About Forms in React

https://leanpub.com/code-react-sweetly

<textarea> element in HTML vs. React

https://leanpub.com/code-react-sweetly

Example: HTML <textarea> component

https://leanpub.com/code-react-sweetly

Example: Controlled <textarea> component

https://leanpub.com/code-react-sweetly

Example: Uncontrolled <textarea> component

https://leanpub.com/code-react-sweetly

<select> element in HTML vs. React

https://leanpub.com/code-react-sweetly

Example: HTML <select> component

https://leanpub.com/code-react-sweetly

Example: Controlled <select> component

https://leanpub.com/code-react-sweetly

Example: Uncontrolled <select> component

https://leanpub.com/code-react-sweetly

Using one event handler for multiple controlled components is permitted

https://leanpub.com/code-react-sweetly

Uncontrolled vs. controlled form component

https://leanpub.com/code-react-sweetly

A form in React can have both controlled and uncontrolled components

https://leanpub.com/code-react-sweetly

Time to Practice with React Forms

https://leanpub.com/code-react-sweetly

How Did You Go About Creating Your Form App?

https://leanpub.com/code-react-sweetly

1. Create a new project directory

https://leanpub.com/code-react-sweetly

2. Install React and ReactDOM

https://leanpub.com/code-react-sweetly

3. Create the web page

https://leanpub.com/code-react-sweetly

4. Create a components directory

https://leanpub.com/code-react-sweetly

5. Create the TaskListMaker component

https://leanpub.com/code-react-sweetly

6. Create the root component

https://leanpub.com/code-react-sweetly

7. Create the entry script

https://leanpub.com/code-react-sweetly

8. Run your application

https://leanpub.com/code-react-sweetly