Skip to content

Reactive declarations not reflecting binding values before onMount #3470

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

Closed
Rich-Harris opened this issue Aug 28, 2019 · 4 comments
Closed

Comments

@Rich-Harris
Copy link
Member

Describe the bug

Reactive declarations that depend on values that are initialised from bindings are incorrect during onMount.

To Reproduce

https://svelte.dev/repl/1d7a000815544ddbb53044b949596ed6?version=3.9.1

Expected behavior

I expected w and h to be correct by the time the onMount code ran. I'm not certain if that's a reasonable expectation.

Severity

Meh

@ghost
Copy link

ghost commented Aug 28, 2019

Also doesn't work with afterUpdate, which surprised me.
https://svelte.dev/repl/b55383ad34ea445cb36121118a8843c8?version=3.9.1

@Conduitry Conduitry added the bug label Aug 29, 2019
@Conduitry
Copy link
Member

This seems related to #2816, but I'm not positive it's exactly the same, as that issue involved component prop binding. Like that issue, this one can also be worked around by waiting a tick at the beginning of onMount.

@stale
Copy link

stale bot commented Jun 27, 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 27, 2021
@stale
Copy link

stale bot commented Jul 11, 2021

This issue has been closed as it was previously marked as stale and saw no subsequent activity.

@stale stale bot closed this as completed Jul 11, 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