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

don't throw error if component is destroyed twice #735

Merged
merged 2 commits into from
Aug 4, 2017
Merged

Conversation

Rich-Harris
Copy link
Member

closes #643

@PaulBGD
Copy link
Member

PaulBGD commented Jul 30, 2017

Isn't there a deeper issue here that a component shouldn't be getting destroyed twice?

@Rich-Harris
Copy link
Member Author

This is for when the user destroys the component twice, not Svelte itself. Specifically, in the <Modal> example in the guide, showModal is being set to false when the modal is destroyed, which has the effect of destroying it a second time.

Definitely a case of user error (in this case, the user was me), and you could argue that Svelte shouldn't go out of its way like that. My main reason was that if I can make that mistake, anyone can... it's not something I have a strong opinion about, just saw an opportunity to close an easy issue 😀

@PaulBGD
Copy link
Member

PaulBGD commented Jul 30, 2017

How about we add a dev warning too then?

@Rich-Harris Rich-Harris merged commit f7738fe into master Aug 4, 2017
@Rich-Harris Rich-Harris deleted the gh-643 branch August 4, 2017 02:14
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

Successfully merging this pull request may close these issues.

Runtime error with nested components, {{#if}}s, and {{yield}}
2 participants