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
Try to enter something different than "John" in the input and submit it
Observe correct error being displayed
Enter correct answer "John" and submit the form
Observe the client-side error because of the action state being undefined despite having an initial value
Current vs. Expected behavior
Current:
After successful submission and being redirected back to the page with the form the action state is undefined despite having an initial value provided. Types don't reflect that possibility as well.
Expected:
After successful submission and being redirected back to the page with the form the action state is back to the initial state
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 8
Binaries:
Node: 20.10.0
npm: 10.2.3
Yarn: 1.22.19
pnpm: 8.15.7
Relevant Packages:
next: 15.0.0-canary.102 // Latest available version is detected (15.0.0-canary.102).
eslint-config-next: N/A
react: 19.0.0-rc-06d0b89e-20240801
react-dom: 19.0.0-rc-06d0b89e-20240801
typescript: 5.3.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
From what I've tested it seems to be present even back in the 14.0.0 release that marked server actions as stable (with useFormState instead of useActionState of course).
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/pawelblaszczyk5/use-action-state-missing-state
To Reproduce
state
being undefined despite having an initial valueCurrent vs. Expected behavior
Current:
After successful submission and being redirected back to the page with the form the action state is undefined despite having an initial value provided. Types don't reflect that possibility as well.
Expected:
After successful submission and being redirected back to the page with the form the action state is back to the initial state
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 20.10.0 npm: 10.2.3 Yarn: 1.22.19 pnpm: 8.15.7 Relevant Packages: next: 15.0.0-canary.102 // Latest available version is detected (15.0.0-canary.102). eslint-config-next: N/A react: 19.0.0-rc-06d0b89e-20240801 react-dom: 19.0.0-rc-06d0b89e-20240801 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
From what I've tested it seems to be present even back in the 14.0.0 release that marked server actions as stable (with
useFormState
instead ofuseActionState
of course).The text was updated successfully, but these errors were encountered: