Store updates break transitions and components
See original GitHub issueDescribe the bug Components with an out:[transition] and a store subscription don’t get destroyed if the store is updated while out:[transition] is in progress.
To Reproduce https://svelte.dev/repl/00d38994d0364ea3a3ae629937142ea6?version=3.12.1
- Create a store
- Subscribe to it in component A
- Create an element with
out:fade
in component A - Destroy component A and trigger a store update before the animation has completed Result: component A never got destroyed.
Expected behavior Components should be destroyed
Severity Very. It breaks apps without a single warning or error. This means that the more complex/nested your app is, the harder it is to troubleshoot.
Additional context Any app that relies on URL params to update the store is highly susceptible to this bug. I ran into it with Sapper as well.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:15 (6 by maintainers)
Top Results From Across the Web
9. Updates, Transitions, and Motion - Interactive Data ...
Chapter 9. Updates, Transitions, and Motion Until this point, we have used only static datasets. But real-world data almost always changes over time....
Read more >How to prevent shared state in a parent component from ...
Unfortunately, whenever the state in the parent element is changed, i.e. the button is clicked and the state is updated, the CSS updates...
Read more >React 18 : Concurrency, Automatic Batching, Transitions & ...
React has always used batching for grouping state updates using event handlers and inbuilt hooks. Doing so helps prevent components from ...
Read more >What's New in React 18 Alpha? Concurrency, Batching, ...
Updates wrapped in startTransition are marked as non-urgent and are interrupted if more urgent updates like clicks or key presses come in. If...
Read more >Add, change, or remove transitions between slides
A transition determines how a slide enters, and how the previous slide exits. So if (for example) you didn't want a transition effect...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in 3.21.0 - https://svelte.dev/repl/00d38994d0364ea3a3ae629937142ea6?version=3.21.0
I can confirm this is still an issue as described, except the threshold I found was 240ms. Anything above that and this bug occurs; 240ms or below, it works as expected.
Here you can see an example REPL: https://svelte.dev/repl/c2ec0888fcf044f78b0ab05c446d5787?version=3.24.1