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

Reactivity incorrectly executed when a variable is referenced in a function #8582

Closed
raythurnvoid opened this issue May 12, 2023 · 2 comments
Labels

Comments

@raythurnvoid
Copy link

raythurnvoid commented May 12, 2023

Describe the bug

When a variable is referenced inside a function, svelte will incorrectly mark it as dirty even when it hasn't been updated with value = ...

Reproduction

https://svelte.dev/repl/8d8f53d0059c43df96e7e233f23fc567?version=3.59.1

writing in the first input field will trigger a log in console that is not expected.

Logs

No response

System Info

REPL

Severity

annoyance

@gtm-nayan
Copy link
Contributor

gtm-nayan commented May 12, 2023

It doesn't have anything to do with onMount. It's that you're binding to a variable that's reactively assigned.

Related #4933 , Duplicate of #7704

@gtm-nayan gtm-nayan added the bug label May 12, 2023
@raythurnvoid raythurnvoid changed the title Reactivity incorrectly executed when a variable is referenced in a function defined in onMount Reactivity incorrectly executed when a variable is referenced in a function May 12, 2023
@gtm-nayan gtm-nayan closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
@raythurnvoid
Copy link
Author

raythurnvoid commented May 12, 2023

It doesn't have anything to do with onMount. It's that you're binding to a variable that's reactively assigned.

Related #4933 , Duplicate of #7704

You are right, I did more tests, and this happens regardless of onMount, I've changed title and description to avoid confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants