Create-react-app: Get rid of white flash on page reload?

Created on 6 May 2018  路  9Comments  路  Source: facebook/create-react-app

Whenever I save my code, the page gets reloaded and I see a white screen flash until my code replaces it.
I am using a custom firefox theme that makes everything black including the new tab/page.
Somehow, it seems this is being overriden when I am developing with create-react-app.

I have tried adding background-color to the body inside the index.html, but that did not seem to stop the flashing.

Any idea how to get rid of this?

Most helpful comment

server side rendering

All 9 comments

ssr

ssr?

server side rendering

https://medium.com/@benlu/ssr-with-create-react-app-v2-1b8b520681d9

Ah, I was considering adding loadable-components to my projects, but was not aware that this in combination with ssr would actually help my loadup time.
Thx, I'll look into this and close the issue if it works and have no further questions.

Actually, turned out there is a much simpler solution.
I am ejected from create-react-app so I can fiddle with the default index.html.
I simply added:

    <style>
      body {
        background-color: black;
      }
    </style>

To the head. And voila!

you didn't need to eject to do that, well good it worked!

I had ejected for other reasons, so I wasn't sure if it would work without it :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wereHamster picture wereHamster  路  3Comments

alleroux picture alleroux  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

rdamian3 picture rdamian3  路  3Comments

oltsa picture oltsa  路  3Comments