From 317dcf371a0ab68de27fc846da3137d14d224f4e Mon Sep 17 00:00:00 2001 From: Josh Story Date: Thu, 25 Apr 2024 14:11:45 -0700 Subject: [PATCH] Fix code example in React-19 `useOptimistic` section (#6781) should assign the result of updateName Co-authored-by: Tim Neutkens --- src/content/blog/2024/04/25/react-19.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/blog/2024/04/25/react-19.md b/src/content/blog/2024/04/25/react-19.md index 471fb3876..d5c5b6157 100644 --- a/src/content/blog/2024/04/25/react-19.md +++ b/src/content/blog/2024/04/25/react-19.md @@ -211,7 +211,7 @@ function ChangeName({currentName, onUpdateName}) { const submitAction = async formData => { const newName = formData.get("name"); setOptimisticName(newName); - await updateName(newName); + const updatedName = await updateName(newName); onUpdateName(updatedName); };