4 ms·
Also, for whatever it's worth, the js could be written more concisely as ['Hello', 'world'].forEach( text => MyComponent .appendChild(document.createEl
by bijection 10y ago
Also, for whatever it's worth, the js could be written more concisely as
['Hello', 'world'].forEach( text => MyComponent
.appendChild(document.createElement('p'))
.appendChild(document.createElement('span'))
.textContent = text
)
- danabramov 10y agoThis doesn't really help you with updates at all, only with initial mounting. In React, elements describe the current tree, and React figures out how to apply changes between the trees.