I am beginner with React and I have a such problem that when I use ReactDom.render there's no output in the browser. I am running the application with
npm start
My previous problem was an error that every time application was run I got:
Target is not a DOM element.
The issue was that index.js was invoked before index.html.
index.js file
document.addEventListener('game', function() {
ReactDOM.render(
"sss",
document.getElementById('game')
);
});
How should look index.html file to run properly? I have here (index.html) only one line:
<div id="game"></div>
I was using tutorial where index.html didn't contain any html or head tags. Regards