Skip to content

Commit

Permalink
docs: Correct useFormStatus to be a client component
Browse files Browse the repository at this point in the history
The `useFormStatus` needs to be used in a client component. That
component should be used within a `form` for the `pending` property to
reflect the form status.
  • Loading branch information
ethanmick committed Jun 8, 2023
1 parent 5150506 commit d64682b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ export function Thread({ messages }) {
The **experimental** `useFormStatus` hook can be used within Form Actions, and provides the `pending` property.
```jsx filename="app/form.js"
'use client'

import { experimental_useFormStatus as useFormStatus } from 'react-dom'

function Submit() {
Expand Down

0 comments on commit d64682b

Please sign in to comment.