|
|
|
|
|
by unsupp0rted
1281 days ago
|
|
I had the opposite feeling a month or so ago, especially with stores- there's so much "magic" that I kept running into confusing walls. If I `export let` a variable to be reactive over here, why isn't it reactive over there? |
|
You can even create variables reactive to one another by declaring a variable like so:
$: y = x * 2
Using the export let x = default; option is for passing data from the parent component/page to a child. If you want variable changes in the child to be reflected in the parent, you can use a store ($ notation), or you can use bind like so:
<ChildComponent bind:x={someValue}>
In my opinion, all of this is much much easier than in competing frameworks.