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

Unnecessary Slot scope reflow #5894

Open
pushkine opened this issue Jan 18, 2021 · 2 comments
Open

Unnecessary Slot scope reflow #5894

pushkine opened this issue Jan 18, 2021 · 2 comments

Comments

@pushkine
Copy link
Contributor

<script>
    let bar = 0;
</script>
<button on:click={()=>bar++} />
<Component let:bar>
    {bar}
</Component>

Having a variable named the same way as a component slot variable wrongly flags $$scope and updates the component everytime bar changes in the outer scope, which is pointless since the Component overwrites bar with its inner scope value

See repl with <Component>'s reflow count
https://svelte.dev/repl/2ec2b3838cf44ed8ac3063cc5f25551c?version=3.31.2

@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 27, 2021
@stale
Copy link

stale bot commented Dec 24, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants