Uploaded May 2025 | Updated September 2026, 3 weeks ago
Sponsors:
Sentry: sentry.io
CKEditor: ckeditor.com
Mullvad: mullvad.net
Windmill: https://www.windmill.dev/
Vercel: vercel.com
Sponsors:
Sentry: sentry.io
CKEditor: ckeditor.com
Mullvad: mullvad.net
Windmill: https://www.windmill.dev/
Vercel: vercel.com










![Advent of Svelte 2025 - Day 21: createContext #javascript #sveltejs #webdevelopment
Previously, sharing values through component trees required importing getContext and setContext, creating a Symbol to avoid string collisions, and exporting typed wrapper functions. With createContext, you simply call it with your type and get back a typed [get, set] tuple — no symbols, no strings, no boilerplate.
In this example, Santas naughty-and-nice list app uses createContext to share a notification function across deeply nested components.
Read the docs: https://svelte.dev/docs/svelte/context#Type-safe-context Advent of Svelte 2025 - Day 21: createContext #javascript #sveltejs #webdevelopment](https://i.ytimg.com/vi/ouM0cjYM7KU/mqdefault.jpg)