Updated docs#bind_component

Removed note about an error that no longer exists and removed boilerplate code from an example
pull/6852/head
Dan Armour 5 years ago
parent 480ec2f932
commit 497ba9bf04

@ -1348,12 +1348,10 @@ bind:this={component_instance}
Components also support `bind:this`, allowing you to interact with component instances programmatically.
> Note that we can't do `{cart.empty}` since `cart` is `undefined` when the button is first rendered and throws an error.
```sv
<ShoppingCart bind:this={cart}/>
<button on:click={() => cart.empty()}>
<button on:click={cart.empty}>
Empty shopping cart
</button>
```

Loading…
Cancel
Save