dillon1000/react
Commit
Browse files fix[devtools/useMemoCache]: add stub for useMemoCache in ReactDebugHook (#27472)
Currently, we have this error in our logs of the internal version of
React DevTools:
```
TypeError: Cannot read properties of undefined (reading 'memoCache')
at Proxy.useMemoCache (chrome-extension://dnjnjgbfilfphmojnmhliehogmojhclc/build/react_devtools_backend_compact.js:151:71)
```
Looking at the build files of the extension, it fails here:
https://github.com/facebook/react/blob/dddfe688206dafa5646550d351eb9a8e9c53654a/packages/react-debug-tools/src/ReactDebugHooks.js#L333-L337
Looks like `updateQueue` can be `undefined`, as it is not defined in
hook object here:
https://github.com/facebook/react/blob/dddfe688206dafa5646550d351eb9a8e9c53654a/packages/react-reconciler/src/ReactFiberHooks.js#L180-L186
~~Also, it looks like `useMemoCache` implementation doesn't expect this,
so it should also result into TypeError here, line 1114:~~
https://github.com/facebook/react/blob/dddfe688206dafa5646550d351eb9a8e9c53654a/packages/react-reconciler/src/ReactFiberHooks.js#L1108-L1115
~~Should this also be updated?~~Changed paths4 files
First-parent comparisonpackages/react-debug-tools/src/ReactDebugHooks.js ModifiedM packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js ModifiedM packages/react-devtools-shell/src/app/InspectableElements/InspectableElements.js ModifiedA packages/react-devtools-shell/src/app/InspectableElements/UseMemoCache.js AddedPatch
Files changed
Rendering syntax-highlighted changes…