we are facing many challenges regarding React mounting. We have our
MountingService, which works for most of the cases, but it leaves us to solve the corner cases of mounting on ajax loaded html fragments and a lot of problems with unmounting the components correctly.
I would like to propose a better (I believe) solution of components mounting, using a
webcomponents are native in most of modern browsers (except Edge ) and has polyfills for the ones, who do not support them yet (even Edge ).
That way we would move the responsibility with handling of mounts/unmounts to the browser native capabilities. That way we should be on a safe side and whole mounting/unmounting should work much smoother.
There is a POC of mine, for not making this too long, I will link it and depending on feedback I would make some deep dive. POC have got two parts:
Please share your thoughts on the topic.