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] remove script tag immediately #26233

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

mondaychen
Copy link
Contributor

@mondaychen mondaychen commented Feb 24, 2023

Fixes #25924 for React DevTools specifically.

Summary

If we remove the script after it's loaded, it creates a race condition with other code. If some other code is searching for the first script tag or first element of the document, this might broke it.

How did you test this change?

I've tested in my local build that even if we remove the script tag immediately, the code is still correctly executed.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 24, 2023
@mondaychen mondaychen merged commit 5641660 into facebook:main Feb 24, 2023
github-actions bot pushed a commit that referenced this pull request Feb 24, 2023
Fixes #25924 for React DevTools
specifically.

## Summary

If we remove the script after it's loaded, it creates a race condition
with other code. If some other code is searching for the first script
tag or first element of the document, this might broke it.

## How did you test this change?

I've tested in my local build that even if we remove the script tag
immediately, the code is still correctly executed.

DiffTrain build for [5641660](5641660)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Scripts injected by browser extensions (e.g. React dev tools) may cause hydration errors
3 participants