[React 19] form.requestSubmit()
resets input value/defaultValue after transition
#30532
Labels
form.requestSubmit()
resets input value/defaultValue after transition
#30532
Summary
When form is submitted through
form.requestSubmit()
the input displays the older value instead of the current state.Peek.2024-07-30.12-45.mp4
I tested using
value
anddefaultValue
props, and both leads to the same issue. When the form is submitted through<button type="submit">
it works fine, andform.submit()
also has no problem, the issue is only usingform.requestSubmit()
.I suspect that this is an issue in
react-dom
reconciler. The state is correct in the log, but the actual<input>
value is not.In the repro there is an
useOptimistic
but this happens without it too.Repro: https://stackblitz.com/edit/vitejs-vite-i9sbuj?file=src%2FApp.tsx
Version:
The text was updated successfully, but these errors were encountered: