mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Fix code example in React-19 useOptimistic section (#6781)
should assign the result of updateName Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user