Render app in dynamically added div container instead of static div.

pull/1/head
Icedream 2017-08-19 16:10:44 +02:00
parent e7839f4cb1
commit f957968d41
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,6 @@
<meta name="description" content=""> <meta name="description" content="">
</head> </head>
<body> <body>
<div id="app"></div> <noscript>This website requires JavaScript, please enable it.</noscript>
</body> </body>
</html> </html>

View File

@ -4,4 +4,8 @@ import { render } from 'react-dom';
import './index.sass'; import './index.sass';
import App from './App'; import App from './App';
render(<App />, document.querySelector('#app')); // Create div node to render app in
const rootContainer = document.createElement('div');
document.body.appendChild(rootContainer);
render(<App />, rootContainer);