0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Update text.md

This commit is contained in:
Rich Harris 2019-08-03 12:53:45 -04:00 committed by GitHub
parent 9d90272966
commit c48d3456f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,4 +46,4 @@ const key = {};
We can use anything as a key — we could do `setContext('mapbox', ...)` for example. The downside of using a string is that different component libraries might accidentally use the same one; using an object literal means the keys are guaranteed not to conflict in any circumstance (since an object only has referential equality to itself, i.e. `{} !== {}` whereas `"x" === "x"`), even when you have multiple different contexts operating across many component layers.
> Remember that context is not inherently reactive. If you need context values to be reactive then you can pass a store into context, which *will* be reactive.
> Remember that context is not inherently reactive. If you need context values to be reactive then you can pass a store into context, which *will* be reactive.