You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9925200
Browse filesBrowse the repository at this point in the historyBrowse files
Kartik Sahu
committed
docs: fix Server Functions code examples
Fixes#8537%0A%0AThis commit fixes multiple issues with the Server Functions examples:%0A%0A1. First example (Actions): Added return value {error: null} on success and fixed input to be controlled with value/onChange%0A%0A2. Second example (Form Actions): Renamed to updateNameForm and fixed to accept FormData parameter instead of string, matching React 19 form action behavior%0A%0A3. Third example (useActionState): Renamed to updateNameAction and fixed to accept (previousState, formData) parameters as required by useActionState%0A%0AAll examples now have correct function signatures matching their usage context.
@@ -178,13 +190,26 @@ For more, see the docs for [Server Functions in Forms](/reference/rsc/use-server
178
190
179
191
You can call Server Functions with `useActionState` for the common case where you just need access to the action pending state and last returned response:
0 commit comments