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

<svelte:component this={page} /> adds a component instead of replacing it #6779

Closed
hcrohland opened this issue Sep 27, 2021 · 3 comments
Closed

Comments

@hcrohland
Copy link

Describe the bug

When using transitions and stores in a svelte component the directive <svelte:component this={page} /> does add the component to the bottom when 'page' changes.

Reproduction

https://svelte.dev/repl/4484e9f2c4214cc6a85e8371bac76dbc?version=3.43.0

Logs

No response

System Info

firefox and chrome...

Severity

annoyance

@Conduitry
Copy link
Member

Conduitry commented Sep 27, 2021

This sounds like a duplicate of #6763 or #6226.

@DanielSharkov
Copy link

I got a workaround for anybody having the same issue. Communicate with the viewport from the view components through events. The first event notifies the viewport that the current view has an outro transition which it should await and the second event tells the viewport that the outro has finished and that it may switch to the next component.

Example implementation: https://github.com/DanielSharkov/svelte-router/blob/master/src/Viewport.svelte
Upgraded REPL: https://svelte.dev/repl/0c31ad0d80144f43acecc6753a54b94a?version=3.43.0

I hope this will help someone! 😄

@dummdidumm
Copy link
Member

Fixed in Svelte 5

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

4 participants