From 623cfb06531873c9b765c77572dc2a2f2abece36 Mon Sep 17 00:00:00 2001 From: Scott Wu Date: Thu, 15 May 2025 06:01:24 +0800 Subject: [PATCH] docs: Clarify when is a variable proxied (#15804) * Update 02-$state.md * Update 02-$state.md * Update 02-$state.md * Update documentation/docs/02-runes/02-$state.md --------- Co-authored-by: Rich Harris --- documentation/docs/02-runes/02-$state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/02-runes/02-$state.md b/documentation/docs/02-runes/02-$state.md index 16630a977b..aac006d2f5 100644 --- a/documentation/docs/02-runes/02-$state.md +++ b/documentation/docs/02-runes/02-$state.md @@ -20,7 +20,7 @@ Unlike other frameworks you may have encountered, there is no API for interactin If `$state` is used with an array or a simple object, the result is a deeply reactive _state proxy_. [Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) allow Svelte to run code when you read or write properties, including via methods like `array.push(...)`, triggering granular updates. -> [!NOTE] Classes like `Set` and `Map` will not be proxied, but Svelte provides reactive implementations for various built-ins like these that can be imported from [`svelte/reactivity`](./svelte-reactivity). +> [!NOTE] Class instances are not proxied. You can create [reactive state fields](#Classes) on classes that you define. Svelte provides reactive implementations of built-ins like `Set` and `Map` that can be imported from [`svelte/reactivity`](svelte-reactivity). State is proxified recursively until Svelte finds something other than an array or simple object. In a case like this...