How to get a React component's innerHTML

后端 未结 2 1472
灰色年华
灰色年华 2020-12-11 05:50

I have a react component and I want its innerHTML to pass as prop to an iframe.

render() {
        const page = 
        const iframeConte         


        
2条回答
  •  佛祖请我去吃肉
    2020-12-11 06:42

    Maybe a bit late for a reply, but you may try reaching the react children elements through ref:

    const r = React.useRef(null);
    console.log(r.current.children)
    

提交回复
热议问题