Hello, I use the following code ReactDOM.render(<App />, document.getElementById('app-html')); How so that instead of replacing the contents in the block (app-html) it is supplemented

  • one
    to keep static in one block, and with a render add to the next block downstream. With the help of styles you can arrange it so that it will look like a single whole. - Alex Slobodyansky

1 answer 1

Option 1 (probably not what you need): there are some static data in 'app-html' 'app-content' , dynamic data is added to 'app-content' .

 <div id='app-html'> содержимое <div id='app-content'></div> </div> 

ReactDOM.render(<App />, document.getElementById('app-content'));

Option 2 : implement the <App /> component so that the new content inside it is added to the already existing one. Since the entire contents of the element passed to the ReactDOM.render(<App />, element); method ReactDOM.render(<App />, element); must and will be cleared and replaced with the data of the <App /> component.