Open JulianLang opened 3 years ago
Hey @JulianLang 👋
Thanks for the detailed bug report! It'd be super helpful if you could create a minimal reproduction case, would you be able to create a repository in GitHub that includes the app structure you describe above, and the exact steps needed to reproduce the issue (e.g. which NPM scripts we'd need to run)? That'd be a huge help to me and the team! 🙂
Hi @rwaskiewicz ,
I pushed the repro here: https://github.com/JulianLang/stencil-bug-lifecycle-hooks
You find some steps to get started within the README. Reloading the app several times will show sporadic changes of the order of console logs.
But an interesting thing is, that I could not reproduce the original issue, that the toggle-groups didLoad
are not called in the right order. But since the order is not stable anyway, I assume that was just luck^^
Some examples *:
* (sorry, I renamed Outer
to A
and Inner
to B
in the meantime of the screenshots, but you can reproduce it with my repro for better understanding anyways). Also even in one screenshot, the expected order (in regards to connectedCallback
order vs didLoad
order is not as I would expect.
If you need additional help or info, I'm glad to help :)
Thank you so much!
Hey, I just wanted to recheck what's the status of this issue :) Is there anything I can help with?
Looks related to https://github.com/ionic-team/stencil/issues/3580
Stencil version:
I'm submitting a:
[x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
Consider the following structure:
We have two nested toggle-groups where each should only find their own children. I rely on life-cycle hooks, so that the nested group (B) should look for its children first, mark them as "already belonging", then the next higher toggle-group (A) should search for its children (those, that are not marked yet) and so on.
Unfortunately I see the following life-cycle behavior:
which is not what I expect due to stencil's documentation.
Expected behavior:
The
componentDidLoad
life cycle hook gets called after all children's (slotted or not) as documented here:So it should be:
Steps to reproduce:
connectedCallback
andcomponentDidLoad
to each parent-component (in my case toggle-group) with aconsole.log
Related code:
Other information:
There were already some issues about this before, but unfortunately they got closed. I hope this issue will make it, as I find it is fundamental to any component framework, that life-cycle hooks can be relied on.