Repeatedly load the module during a hot webpack+react UPDAT

clipboard.png

clipboard.png

clipboard.png

when you change the code, you load it again, instead of changing it on the basis of the original

.
Mar.19,2021

the problem lies in document.body.append (app); . Because the file is executed again, it will append again. It is recommended that you first write the root element < div id= "root" > < / div > in html, and then use getElementById () to get


in js.

clipboard.png

has the react rendered once natively?

< hr >
ReactDOM.render(<App />, document.getElementById('root'));
Menu