React operation dom, wants to package a layer of div on a node of the original component referenced (wrap), like jQuery has been operating all day without success

clipboard.png

uitablediv

clipboard.png

use the createPortal method. You can only insert a div, below the table. It is not the desired result. Consult the experienced god.


you just wrap him a layer in render


operate

in componentDidMount of outer components, such as App components
// App.js
componentDidMount() {
    const table = document.getElementById('main-table');
    const div = document.createElement('div');
    const cloneTable = table.cloneNode(true);
    div.appendChild(cloneTable);
    table.parentElement.replaceChild(div, table);
}

never operate dom in react .
maybe you are already familiar with jquery , and use jquery thinking in react to solve problems.
it is difficult to troubleshoot the problems caused by dom .
for example:
obviously the value of state has changed, but the page is not render .

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-1b314ad-2bd89.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-1b314ad-2bd89.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?