Skip to content

Commit 317dcf3

Browse files
gnofftimneutkens
andauthored
Fix code example in React-19 useOptimistic section (#6781)
should assign the result of updateName Co-authored-by: Tim Neutkens <[email protected]>
1 parent 0078b50 commit 317dcf3

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)