create-react-app
create-react-app copied to clipboard
Add a loading indicator for slower connections
On devices with slower connection (<4G) the initial response (this file) shows a blank white page while bundle gets loaded.
Users (and even me as a developer) have experienced this and mistake the site for being unavailable/broken when actually the initial response is sent and JavaScript gets loading.
This should not be the default behavior - even a simple text Loading ... with zero styling text gives some information. It does not leave me worrying if the page is broken - but that something is going on and I should wait.
Adding a fancy svg loader like here does not add to file size (1.9 vs 2.3kB).
Thus something as simple as this would work fine and it will be replaced by react after load anyways.
<div id="root">
<p> Loading ... </p>
</div>
While this not an issue when using frameworks like Next, Gatsby or Remix and the load times can be reduced with code splitting, create-react-app should come out of the box being able to be deployed.
Hi @ace4port!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!