useFormStatus pending state not updating during manual Server Action invocation
0 reputation · 29 Mar 2025, 16:13 UTC
In Next.js (version 13.4+), the useFormStatus hook is designed to provide the pending boolean state to child components of a form during the execution of a Server Action.
While the hook functions as expected during a standard HTML form submission, there is uncertainty regarding its behavior when the Server Action is triggered programmatically. Specifically, when an action is invoked via a JavaScript event handler (such as an onClick event) rather than the native form submission process, the transition state may not propagate to the hook.
Given that Server Actions integrate with the React Transition API, it is unclear how to maintain the pending state for child components when bypassing the default form submission flow.
- Does
useFormStatussupport manual invocations of Server Actions? - What is the recommended architectural approach to synchronize the
pendingstate across child components when a form is not submitted natively?