Skip to content

Why is binding with child components rendering two times on the first load? #6590

Closed
@frederikhors

Description

@frederikhors

Describe the bug

Why do I get two times the console.log()?

Reproduction

https://svelte.dev/repl/e27091c87e9f429b9eac1e3fdc6d20d3?version=3.41.0

  • App.svelte:
<script>
  import Child from './Child.svelte'  
	
  let filter = { 
    value: "hello world"
  }
	
  $: console.log(filter)
</script>

<h2>Parent:</h2> {filter.value}

<input bind:value={filter.value}>

<br><br>

<h2>Child:</h2> <Child bind:filter />
  • Child.svelte:
<script>
  export let filter = undefined
	
</script>

<input bind:value={filter.value}>

Severity

performances penalty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions