A way to return raw HTML from an unmounted component?
I've asked the same question here but it seems that the only way is to use ReactDOMServer.renderToStaticMarkup(component) which must be a mounted component first, and I'd just like to feed raw HTML to a plugin like the above linked question.
I also like to avoid jQuery with this, and just have a way to mount a component in the shadow, and then have the raw HTML ( not sure how it's called, when you console.log a html element, in chrome it outputs the html as a sort of native html object )
The only other way I can imagine is using a ref to an element, but that still has to be mounted.
Server-side components are never mounted (and componentDidMount doesn't fire on the server). ReactDOMServer.renderToStaticMarkup will literally just generate HTML markup to use.
See this fiddle: https://jsfiddle.net/onq7ooyj/1/