简体   繁体   中英

How to unmount webcomponent used inside react component?

I am using web component inside react component. when I unmount react component, it seems web component inside react component is not being unmounted properly, because when I mount the react component again, webcomponent props update method is being called and then throws error

Uncaught TypeError: Cannot read property 'appendChild' of null

I am using skate js to create webcomponent.

How to properly unmount the web component. please help, I would always be thakful.

Please let me know if any more information is required.

I solved this. The Widget component was not being unmounted properly. I have to remove it forcefully form dom using

Mozilla docs removeChild

After that it works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM