-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
$$restProps
is updated even when normal prop values are changed
#7004
Comments
I think the root cause is the same as #6921 In order to decide whether to recalculate a svelte/src/runtime/internal/utils.ts Lines 39 to 41 in 683c39a
This seems to be the intended behavior, at least from the code. |
Okay but still nothing in the |
Can you explain the benefit of eliminating this small inefficiency? |
Close this because there was no clear explanation here. |
Describe the bug
This is a small thing but I wanted to know whether it could be fixed or it was done intentionally. Here's the REPL.
What's happening here in this example is that whenever the value of the prop
rating
changes, it's as if$$restProps
is also updated, and as a result, every part of the component that's referencing$$restProps
would be notified and re-rendered, even though the contents of$$restProps
haven't changed at all.For
$$props
this would of course make sense, but not for$$restProps
since therating
prop is a normal component prop and would never be included in$$restProps
. So, any changes to it shouldn't really concern$$restProps
at all.This is a small inefficiency and I was curious as to why it happens.
Thanks.
Severity
annoyance
The text was updated successfully, but these errors were encountered: