I think there is nothing wrong with your backend updateName function its just your page.tsx that never re-rerenders.You can use this function router.refresh() just after this line await updateName(name as string);