Hi,
I am not getting my component rendered in ReactDOM. Can anybody please help. My snippet link is here
Got it fixed.
Donot know why…this was not working
<script src='bundle.js'></script>
<div id='root'></div>
…but then this worked
<div id='root'></div>
<script src='bundle.js'></script>
Also if I comment script tag, it works, as:
<div id='root'></div>
<!-- <script src='bundle.js'></script> -->
I suspect that first does not work since the script loads and executes the bundle earlier than div with id root is added to the page. The second variant eliminates this issue cause script is added after div.
The third option also works cause VizHub shallowly adds bundle script at the very end of body
tag (definitely after your div with root id)
1 Like