Skip to content

Commit 2e74dbb

Browse files
Sync svelte docs (#1612)
sync svelte docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent 46a0819 commit 2e74dbb

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

apps/svelte.dev/content/docs/svelte/98-reference/.generated/shared-errors.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ Certain lifecycle methods can only be used during component initialisation. To f
6060
<button onclick={handleClick}>click me</button>
6161
```
6262

63+
### missing_context
64+
65+
```
66+
Context was not set in a parent component
67+
```
68+
69+
The [`createContext()`](svelte#createContext) utility returns a `[get, set]` pair of functions. `get` will throw an error if `set` was not used to set the context in a parent component.
70+
6371
### snippet_without_render_tag
6472

6573
```

apps/svelte.dev/content/docs/svelte/98-reference/20-svelte.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SvelteComponentTyped,
1313
afterUpdate,
1414
beforeUpdate,
15+
createContext,
1516
createEventDispatcher,
1617
createRawSnippet,
1718
flushSync,
@@ -221,6 +222,20 @@ function beforeUpdate(fn: () => void): void;
221222

222223

223224

225+
## createContext
226+
227+
Returns a `[get, set]` pair of functions for working with context in a type-safe way.
228+
229+
<div class="ts-block">
230+
231+
```dts
232+
function createContext<T>(): [() => T, (context: T) => T];
233+
```
234+
235+
</div>
236+
237+
238+
224239
## createEventDispatcher
225240

226241
<blockquote class="tag deprecated note">

apps/svelte.dev/content/docs/svelte/98-reference/30-runtime-errors.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,14 @@ Certain lifecycle methods can only be used during component initialisation. To f
358358
<button onclick={handleClick}>click me</button>
359359
```
360360

361+
### missing_context
362+
363+
```
364+
Context was not set in a parent component
365+
```
366+
367+
The [`createContext()`](svelte#createContext) utility returns a `[get, set]` pair of functions. `get` will throw an error if `set` was not used to set the context in a parent component.
368+
361369
### snippet_without_render_tag
362370

363371
```

0 commit comments

Comments
 (0)