Check out example codes for "innertext vs innerhtml". It will help you in understanding the concepts better.

Code Example 1

innerHTML shows everything inside of the element.
innerText shows only the text inside of the element.

Code Example 2

Inner text below. It inject string as it is into the element.
My name is <b class="name">Raj Yadav</b>.

Inner html below. It renders the string into the element and treat as part of html document.
My name is Raj Yadav.

Learn ReactJs, React Native from akashmittal.com