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
)