Skip to content

Commit 0039859

Browse files
timneutkensgnoff
authored andcommitted
Fix code example in React-19 useOptimistic section
should assign the result of updateName
1 parent c8a316a commit 0039859

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/blog/2024/04/25/react-19.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function ChangeName({currentName, onUpdateName}) {
211211
const submitAction = async formData => {
212212
const newName = formData.get("name");
213213
setOptimisticName(newName);
214-
await updateName(newName);
214+
const updatedName = await updateName(newName);
215215
onUpdateName(updatedName);
216216
};
217217

0 commit comments

Comments
 (0)