Markdown previewer how can I add the HTML?

Hey guys,
I’m having some trouble with the markdown previewer.
Basically I have 2 components, parent component holds the textarea and its child is the previewer.
It has input state and markedInput state.
I can’t find a way to add the html as html in the previewer.
anybody can help?

So I found using <div dangerouslySetInnerHTML={{ __html: input }} />
But is it the only way to do this?