I have a react component and I want its innerHTML to pass as prop to an iframe.
render() {
const page = <PrintPage />
const iframeContent = page..something...innerHTML
return (
<iframe srcDoc={iframeContent}/>);
}
Is there any way for doing like this.
I want to render only within the iframe, so i can't use ref. I want the innerHTML of component which is not mounted