I have a Component:
function MyComp(props) {
return (
<div class="myJSX">
Some Content.
{ props.children }
</div>
)
}
I want to get the outerHTML before I render it.
More emphasis on before
Question is about before rendering, answers like this won't help me.
By render, I mean calling
ReactDOM.render
Note: This is in Node.js not purely in-browser. Any node related answer is also very helpful.
No Idea is too bad.
So the outer HTML of:
<MyComp>hello</MyComp>
should look like:
<div class="myJSX">
Some Content.
hello
</div>