-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: react-scan auto on playwright #223
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
commit: |
|
||
requestAnimationFrame(() => { | ||
document.documentElement.appendChild(currentContainer); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the script executed by Playwright runs such that document.documentElement
is null. By using RAF we defer appending the root container.
}; | ||
startReportInterval(); | ||
logIntro(); | ||
requestAnimationFrame(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous one, we want to defer this one to ensure that the documentElement exists.
deprecated |
Currently, React Scan doesn't work when there isn't a React DevTools installed (since RDT initializes the global hook React listens to before React is loaded), which also makes our CLI not work properly.
This fix ensures that the auto script is loaded first before React.