Skip to content

[DevTools] Fix ReactDevToolsBackend module for AMD#35891

Merged
hoxyq merged 1 commit intofacebook:mainfrom
fullstackhacker:react-devtools-amd-fix
Feb 24, 2026
Merged

[DevTools] Fix ReactDevToolsBackend module for AMD#35891
hoxyq merged 1 commit intofacebook:mainfrom
fullstackhacker:react-devtools-amd-fix

Conversation

@fullstackhacker
Copy link
Contributor

Summary

For apps that use AMD, we need to actually require() the ReactDevToolsBackend and load it from the AMD module cache. This adds a check for the case where the ReactDevToolsBackend isn't defined globally, and so we load it with require().

How did you test this change?

Tested through #35886

For apps that use AMD, we need to actually `require()` the
ReactDevToolsBackend and load it from the AMD module cache. This adds a
check for the case where the UMD definiton fell into the AMD branch and
only `require()`s in that case. We can't just check if `require` is
function because Metro does export a `require` function, but for the
Metro case, we wouldn't fall into the AMD branch for UMD.
@meta-cla meta-cla bot added the CLA Signed label Feb 24, 2026
@fullstackhacker fullstackhacker changed the title Fix ReactDevToolsBackend module for AMD [DevTools] Fix ReactDevToolsBackend module for AMD Feb 24, 2026
@hoxyq hoxyq merged commit bd76b45 into facebook:main Feb 24, 2026
236 of 241 checks passed
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