Closed
Description
Website or app
https://github.com/markerikson/react-19-rdt-useformstatus-error
Repro steps
- Clone https://github.com/markerikson/react-19-rdt-useformstatus-error
- Install and run with
yarn && yarn dev
- Browse to http://localhost:5173/useformstatus-example
- Open up the React DevTools Extension and inspect the
<SubmitButton>
component - Observe that the inspection fails with
Cannot destructure property 'pending' of 'useFormStatus(...)' as it is null.
FWIW I ran across this while working on updating Replay.io's own support for React 19 by merging down all the last year's worth of changes to our long-running RDT fork:
and then I was inspecting this <SubmitButton>
component in a Replay recording of the example app, and observed that I see this error when inspecting it in the recording:
- Open https://app.replay.io/recording/e2e-example-rdt-react-19distindexhtml--edab8c19-e2a2-4269-bb37-948cd5dff465?commentId=&focusWindow=eyJiZWdpbiI6eyJwb2ludCI6IjAiLCJ0aW1lIjowfSwiZW5kIjp7InBvaW50IjoiMjUzMTI0NDcxODc5NjU0NDMzMTY0NzMzNTcxNTA0NTM3NjAiLCJ0aW1lIjoxMjc1MX19&point=13629779253886577472836196156573656&primaryPanel=debugger&secondaryPanel=react-components&time=6926&viewMode=dev
- Try inspecting
<SubmitButton>
and see that we report "can't inspect the component"
I do note that in the getPrimitiveStackCache()
function in react-debug-tools
, we don't try to warm up Dispatcher.useFormStatus()
. Tried adding that myself and rebuilding our RDT fork bundle, but it didn't seem to fix the behavior, so that may not be relevant.
How often does this bug happen?
Every time
DevTools package (automated)
No response
DevTools version (automated)
No response
Error message (automated)
No response
Error call stack (automated)
No response
Error component stack (automated)
No response
GitHub query string (automated)
No response