menu_book Course Curriculum (Svelte 5) expand_more
Component Syntax
Runes & Reactivity
Composition
Motion & Lifecycle
SvelteKit Routing
Context
Learn Context in Svelte 5 with a dedicated explanation, a concept-specific example, a production caution, and a mastery check.
12 min read
•
Intermediate
svelte-5-022.svelte
svelte
<script>import { setContext,getContext } from "svelte";setContext("currency","PKR");const currency=getContext("currency");</script>
<p>{currency}</p>
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content