mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
to make examples consistent. (#6793)
This commit is contained in:
committed by
GitHub
parent
807001cd9b
commit
537bd05e56
@@ -153,8 +153,8 @@ To make the common cases easier for Actions, we've added a new hook called `useA
|
||||
|
||||
```js
|
||||
const [error, submitAction, isPending] = useActionState(async (previousState, newName) => {
|
||||
const {error} = await updateName(newName);
|
||||
if (!error) {
|
||||
const error = await updateName(newName);
|
||||
if (error) {
|
||||
// You can return any result of the action.
|
||||
// Here, we return only the error.
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user