mirror of https://github.com/sveltejs/svelte
docs: clarify context state getter pattern (#18226)
Closes #18022 This updates the context docs to show the getter pattern for state that may be reassigned, such as primitive state. The new example passes a function through context so children read the current value instead of capturing the initial value. This is a docs-only clarification and does not change runtime behavior. Validation: - `git diff --check` - `pnpm exec prettier --check documentation/docs/06-runtime/02-context.md` Full `pnpm test`/`pnpm lint` were not run because this only changes documentation. --------- Co-authored-by: Rich Harris <hello@rich-harris.dev>pull/18241/head
parent
a5df6616ea
commit
a63bf862c0
Loading…
Reference in new issue