The lifecycle function beforeUnmount did not work properly in some reactively nested scenarios.
In a simple example with one Store and a corresponding Store<*>.render it is working without problems, but when nesting render-blocks, it is only called for the outer MountPoint.
afterMount is called for both, but beforeUnmount is only called for the outer MountPoint. This was a bug, as beforeUnmount must be called recursively on all levels beneath some changing MountPoint!
This PR fixes the issue so it should now work properly in all nesting scenarios.
As PoC also some internal workaround in the portalling-engine has now been refactored towards a more idiomatic approach using beforeUnmount.
The lifecycle function
beforeUnmount
did not work properly in some reactively nested scenarios.In a simple example with one
Store
and a correspondingStore<*>.render
it is working without problems, but when nesting render-blocks, it is only called for the outerMountPoint
.Example:
If one clicks the first button (Update Outer Store) one will get the following logs:
afterMount
is called for both, butbeforeUnmount
is only called for the outer MountPoint. This was a bug, asbeforeUnmount
must be called recursively on all levels beneath some changingMountPoint
!This PR fixes the issue so it should now work properly in all nesting scenarios.
As PoC also some internal workaround in the portalling-engine has now been refactored towards a more idiomatic approach using
beforeUnmount
.fixes #782