Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnMount lifecycle hook run in wrong sequence between parent and child components #4511

Closed
Tbutnyakov opened this issue Mar 5, 2020 · 3 comments

Comments

@Tbutnyakov
Copy link

The problem
Since 3.6.4 version we have a wrong sequence for onMount lifecycle hook.
It run onMount callback first on a child component, instead of parent.

To Reproduce
https://svelte.dev/repl/9eb25e5039844a9588cd96bc7380e672?version=3.6.4

Expected behaviour
Take a look at the console.
Im expect this order for hooks calls:

onMount Parent
onMount Child

Instead we got:

onMount Child
onMount Parent

@tanhauhau
Copy link
Member

yes the child get mounted first, before the parent.

this is intended.

see #2281

@direct-fuel-injection
Copy link

yes the child get mounted first, before the parent.

this is intended.

see #2281

this is not the same behavior

@Tbutnyakov
Copy link
Author

@tanhauhau i saw that issue.
It seems like when you fixed that problem you created a new. But much more bigger.

How can you mount an element to a void, can you explain pls?
Where do you mount a child component if you didn't mount its parent yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants