to make examples consistent. (#6793)

This commit is contained in:
Shubhdeep Chhabra
2024-04-27 01:10:06 +05:30
committed by GitHub
parent 807001cd9b
commit 537bd05e56

View File

@@ -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;