dillon1000/react

Commit

[DevTools] Using array destructuring without assigning first variable does not error (#22129)

## Summary

Before this commit, if a hook returned an array the was destructured, but without assigning a variable to the first element in the array, this would produce an error. This was detected via internal testing.

This commit fixes that and adds regression tests.


## Test Plan

- yarn flow
- yarn test
- yarn test-build-devtools
- added new regression tests 
- named hooks still work on manual test of browser extension on a few different apps (code sandbox, create-react-app, internally).
Browse files
Changed paths3 files
First-parent comparison
M packages/react-devtools-extensions/src/__tests__/__source__/__untransformed__/ComponentWithUseState.js ModifiedM packages/react-devtools-extensions/src/__tests__/parseHookNames-test.js ModifiedM packages/react-devtools-extensions/src/astUtils.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…