1

I have an app that takes some time to load its JavaScript assets. There is a root div container <div id="root"></div> into which the app is loaded.

While it's not initialised, I am showing a spinner div with some inline styling which begins showing instantly when I load page.

As I see, React just empties the container and puts everything it wants into it then, so any crap inside that container before React initialisation shouldn't break anything?

Are there reasons not to do it like so?

Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335
  • 2
    [Here](https://stackoverflow.com/a/40989121/381802) is a nice solution. Feels like a duplicate question to me. – erikvimz Dec 20 '17 at 18:09

1 Answers1

0

You can do it like that, it's ok. It's not really clean, but I can't see drawbacks in your approach.

Sebastian Giro
  • 718
  • 1
  • 7
  • 17