show error in console if root node isn't found

This commit is contained in:
igoradamenko
2018-01-23 20:15:35 +02:00
parent 1f4e1b160f
commit 59c9d59ad0
+4 -1
View File
@@ -17,7 +17,10 @@ if (document.readyState !== 'complete') {
function initApp() {
const node = document.getElementById(id);
if (!node) return;
if (!node) {
console.error('Remark42: Can\'t find root node.');
return;
}
render(<Root/>, node.parentElement, node);
}