Defer React script until DOM is ready #2989
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
LBRY-DESKTOP-WEB-PRD Target container is not a DOM element aka "white screen"
Reproduce: make a bookmark of the site, and keep clicking it with variations in delay
Root/Change
<body>
, to listening toDOMContentLoaded
.defer
tag -- it's the same asasync
(start fetch in parallel), but only executes after the DOM is ready.Caveat
On Chrome, clicking on a bookmark will utilize the cached version of
index.html
(maybe this was what some users were doing when they say they are "reloading").The fix will only take effect on regular F5 (or clicking the button, or clicking our Reload nag).