React using react component inside of dangerouslySetInnerHTML

后端 未结 3 505
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-12 12:46

I have a question about using react. As you can see from the title, I\'m wondering if it is possible to use React component(that is created by React.createClass) inside of \

3条回答
  •  -上瘾入骨i
    2021-01-12 13:06

    Another approach would be to open a react portal. Ensure that the element has rendered and then simply

    ReactDOM.createPortal(,document.querySelector('selector'));

    This is the cleanest way so far i have found to achieve this.

提交回复
热议问题