From 4e64a567ab778a3abeae21634729e5c787f1e5bc Mon Sep 17 00:00:00 2001 From: DaviOliveiraSilva Date: Thu, 6 Nov 2025 10:45:33 -0300 Subject: [PATCH] docs: clarify usage of $bindable for bidirectional bindings and its possivle riscs --- documentation/docs/02-runes/06-$bindable.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/docs/02-runes/06-$bindable.md b/documentation/docs/02-runes/06-$bindable.md index c12c2bf4903e..508b02abe12f 100644 --- a/documentation/docs/02-runes/06-$bindable.md +++ b/documentation/docs/02-runes/06-$bindable.md @@ -6,6 +6,8 @@ Ordinarily, props go one way, from parent to child. This makes it easy to unders In Svelte, component props can be _bound_, which means that data can also flow _up_ from child to parent. This isn't something you should do often, but it can simplify your code if used sparingly and carefully. +> [!NOTE] `$bindable` enables bidirectional bindings between components. While convenient, it should be used with care — frequent use can make your data flow unpredictable and your components harder to maintain. In most cases, prefer one-way data flow and explicit updates through events or stores. + It also means that a state proxy can be _mutated_ in the child. > [!NOTE] Mutation is also possible with normal props, but is strongly discouraged — Svelte will warn you if it detects that a component is mutating state it does not 'own'.