Skip to content

Conversation

@Raghuboi
Copy link

Summary

Adds regression test for issue #20613 where DevTools crashes when inspecting components with custom hooks named "useState". This has been a known issue since 2021 affecting libraries like Hookstate that export custom hooks with this naming pattern.

How did you test this change?

Added test case to packages/react-devtools-shared/src/__tests__/inspectedElement-test.js that creates a custom hook function named useState, uses both the custom hook and React's built-in useState, and verifies DevTools can inspect the component without throwing.

Ran yarn test-build-devtools to verify the test passes and all existing DevTools tests continue to work.

@meta-cla meta-cla bot added the CLA Signed label Aug 15, 2025
@rickhanlonii
Copy link
Member

We have a test for this added here, and the issue was fixed: #28413

@Raghuboi if you're generating these PRs with AI, please stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants