electrode-io / electrode

Web applications with node.js and React
Other
2.1k stars 300 forks source link

feat: expose subapp root to provide better lifecycle control for applications #2008

Closed arunvishnun closed 6 months ago

arunvishnun commented 6 months ago

Summary

In React 18, unmountComponentAtNode was replaced by root.unmount().

Reference: https://react.dev/reference/react-dom/unmountComponentAtNode#unmountcomponentatnode

To accommodate this update, this PR modifies the implementation to expose the root object. By doing so, it enables applications built with SubappV1 to leverage root.unmount() for managing component lifecycles more effectively.