Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DevTools Bug]: Null destructuring error inspecting a component with useFormStatus #29788

Closed
markerikson opened this issue Jun 6, 2024 · 1 comment · Fixed by #28728
Closed

Kommentare

@markerikson
Copy link
Contributor

Website or app

https://github.com/markerikson/react-19-rdt-useformstatus-error

Repro steps

  1. Clone https://github.com/markerikson/react-19-rdt-useformstatus-error
  2. Install and run with yarn && yarn dev
  3. Browse to http://localhost:5173/useformstatus-example
  4. Open up the React DevTools Extension and inspect the <SubmitButton> component
  5. Observe that the inspection fails with Cannot destructure property 'pending' of 'useFormStatus(...)' as it is null.

image

/cc @hoxyq @eps1lon

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:

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

@eps1lon
Copy link
Collaborator

eps1lon commented Jun 6, 2024

We'll look into this for 19.1

@eps1lon eps1lon added React 19 and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants