Silind-Software / direflow

🧩 Use the best of two worlds. Create fast, performant, native Web Components using React.
https://direflow.io
MIT License
502 stars 77 forks source link

unmount/remove DireflowComponent #276

Open hirenreshamwala opened 1 year ago

hirenreshamwala commented 1 year ago

Hi,

I want to add/remove web component on demand in my HTML file.

I created a component <demo-button>

//Add
document.body.append('<demo-button id="button1">');

//Remove
document.body.removeChild(document.getElementById('button1'))

This code is adding my component and removing it properly but it shows the following error in the console

Warning: unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.

some forum says I need to unmount it from the react component. But I don't know exactly what I need to do.

Can anyone guide me?

Thanks.