React creates a virtual dom tree

//dom
//  html       
const React = {
    createElement(tag, attrs, ...children) {
        return {
            tag,
            attrs,
            children
        }
    }
};
const render = (vnode, container) => {
    console.log(vnode)
    //****
    if (typeof vnode === "string") {
        //
        const textNode = document.createTextNode(vnode)
        return container.appendChild(textNode)
    }
    //1.dom   <div></div>
    const dom = document.createElement(vnode.tag);
    console.log(dom)
    //children
    //2.
    vnode.children.forEach(child => {
        return render(child, dom)
    })
    return container.appendChild(dom)
}
const ReactDom = {
    render
}
ReactDom.render(
    //render
    React.createElement("div", null, "hello"),
    //dom
    document.getElementById("app")
)

error, Cannot read property "appendChild" of null

Dec.23,2021

document.getElementById("app")

this should not be on the page

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb6b02-25fc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb6b02-25fc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?