6
rated 0 times
[
11]
[
5]
/ answers: 1 / hits: 24107
/ 7 Years ago, thu, february 16, 2017, 12:00:00
I am using web components in my application. And in a web component, I need to insert a react component. Web Component has Shadow DOM. When I try to render the react component using following I get the error.
comp = React.createElement(ReactElem, {
config: config,
onRender: handleRender
});
ReactDOM.render(comp , self.shadowRoot.querySelector('#app1'));
Error
target container is not a dom element
I tried to use content
of Web component API but then it gets rendered on top rather inside component. Any leads how can make React component to get rendered inside shadow DOM?
More From » reactjs