0% found this document useful (0 votes)
15 views3 pages

Built-in React DOM Hooks – React

The document provides an overview of built-in React DOM Hooks, specifically for web applications, and notes that these Hooks are not supported in non-browser environments. It highlights the use of form management Hooks, such as useFormStatus, to create interactive controls for submitting information. An example is provided to illustrate how to implement these Hooks in a form component.

Uploaded by

dungeon.dad87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views3 pages

Built-in React DOM Hooks – React

The document provides an overview of built-in React DOM Hooks, specifically for web applications, and notes that these Hooks are not supported in non-browser environments. It highlights the use of form management Hooks, such as useFormStatus, to create interactive controls for submitting information. An example is provided to illustrate how to implement these Hooks in a form component.

Uploaded by

dungeon.dad87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

20/02/2025, 09:20 Built-in React DOM Hooks – React

v19

API REFERENCE

Built-in React DOM Hooks


The react-dom package contains Hooks that are only supported
for web applications (which run in the browser DOM environment).
These Hooks are not supported in non-browser environments like
iOS, Android, or Windows applications. If you are looking for Hooks
that are supported in web browsers and other environments see
the React Hooks page. This page lists all the Hooks in the react-
dom package.

Form Hooks
Forms let you create interactive controls for submitting information. To
manage forms in your components, use one of these Hooks:

useFormStatus allows you to make updates to the UI based on the status


of the a form.

function Form({ action }) {


async function increment(n) {
return n + 1;
}
const [count, incrementFormAction] = useActionState(increment, 0);
return (
<form action={action}>
<button formAction={incrementFormAction}>Count: {count}</button>
<Button />
</form>
);
}

function Button() {
https://react.dev/reference/react-dom/hooks 1/3
20/02/2025, 09:20 Built-in React DOM Hooks – React

const { pending } = useFormStatus();


return (
<button disabled={pending} type="submit">
Submit
</button>
);
}

NEXT

useFormStatus

Copyright © Meta Platforms, Inc

uwu?

Learn React API Reference

Quick Start React APIs

Installation React DOM APIs

Describing the UI

Adding Interactivity

Managing State

Escape Hatches

Community More

Code of Conduct Blog

Meet the Team React Native

Docs Contributors Privacy

Acknowledgements Terms

https://react.dev/reference/react-dom/hooks 2/3
20/02/2025, 09:20 Built-in React DOM Hooks – React

https://react.dev/reference/react-dom/hooks 3/3

You might also like