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

Component binding to object property triggers parent's reactive statements at init #4447

Closed
pushkine opened this issue Feb 23, 2020 · 2 comments · Fixed by #5890
Closed

Component binding to object property triggers parent's reactive statements at init #4447

pushkine opened this issue Feb 23, 2020 · 2 comments · Fixed by #5890
Labels

Comments

@pushkine
Copy link
Contributor

pushkine commented Feb 23, 2020

Primitive to component and object property to element binding work as expected :

<script>
    ...
    const arr = ['value']
    let primitive = 'value'

    $: primitive    // triggers once at init
    $: arr          // triggers once at init

</script>

<Component bind:value={primitive}/>
<input bind:value={arr[0]}/>

Object property to component binding triggers reactive statements every time the Component is initialized :

<script>
    ...
    const arr = ['value']

    $: arr          // triggers once at init AND at every <Component> init
</script>

<Component bind:value={arr[0]}/>

https://svelte.dev/repl/71f8e6203a1a4e578b19af0eb623b407?version=3.18.2

related : #4430 #4265

@xpuu
Copy link

xpuu commented Dec 14, 2020

This is now 295 days old bug with more than 4 duplicates so far and new one incoming every second week. It's really annoying, workarounds are nasty, especially when using stores. What shall I do to raise attention about this?

@Conduitry
Copy link
Member

Your PR #5890 has been released in 3.32.2 - https://svelte.dev/repl/71f8e6203a1a4e578b19af0eb623b407?version=3.32.2 - thanks!

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

Successfully merging a pull request may close this issue.

5 participants