-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Reactive statement is executed twice when load() returns an object #5201
Comments
I can not reproduce this. |
Sorry it needed an update of the session object which I was doing in a __template.svelte component. Here is a isolated example (I updated the code above as well): |
Edit: Edit II: kit/packages/kit/src/runtime/client/client.js Line 114 in c956744
the client updates the layout/page props: kit/packages/kit/src/runtime/client/client.js Line 287 in c956744
Then this:
becomes relevant again. I don't know if that is intended. |
good catch. I don't think it should be the intention, but if it is documentation of what/why it is happening is probably required :-) |
This seems to be a svelte problem e.g. sveltejs/svelte#5689 (and many more) so closing this issue |
Describe the bug
When a modules
load()
function return an object as a result, reactive statements depending on this result is run twice in the components initializing block receiving the property from the load function. If a simple value is returned the reactive statement only runs once, as expected.Reproduction
Bug?
This will result in the value being printed twice to the console
Expected behavior
Returning a simple value will only make the reactive statement run once
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: