diff --git a/CHANGELOG.md b/CHANGELOG.md index 8decb47ccd66..0a4b7ae56f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Svelte changelog +## Unreleased + +* Actually export `hasContext` ([#5726](https://github.com/sveltejs/svelte/issues/5726)) + ## 3.30.0 * Add a typed `SvelteComponent` interface ([#5431](https://github.com/sveltejs/svelte/pull/5431)) diff --git a/src/runtime/index.ts b/src/runtime/index.ts index e6c0c916f23e..f1154b092f69 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -7,6 +7,7 @@ export { afterUpdate, setContext, getContext, + hasContext, tick, createEventDispatcher, SvelteComponentDev as SvelteComponent diff --git a/test/runtime/samples/context-api-c/Leaf.svelte b/test/runtime/samples/context-api-c/Leaf.svelte new file mode 100644 index 000000000000..ae61ba063c41 --- /dev/null +++ b/test/runtime/samples/context-api-c/Leaf.svelte @@ -0,0 +1,7 @@ + + +
{has}
\ No newline at end of file diff --git a/test/runtime/samples/context-api-c/Nested.svelte b/test/runtime/samples/context-api-c/Nested.svelte new file mode 100644 index 000000000000..775d55d8f125 --- /dev/null +++ b/test/runtime/samples/context-api-c/Nested.svelte @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/context-api-c/_config.js b/test/runtime/samples/context-api-c/_config.js new file mode 100644 index 000000000000..0041359a7f53 --- /dev/null +++ b/test/runtime/samples/context-api-c/_config.js @@ -0,0 +1,6 @@ +export default { + html: ` +
true
+
false
+ ` +}; diff --git a/test/runtime/samples/context-api-c/main.svelte b/test/runtime/samples/context-api-c/main.svelte new file mode 100644 index 000000000000..03ff1ae6eb44 --- /dev/null +++ b/test/runtime/samples/context-api-c/main.svelte @@ -0,0 +1,12 @@ + + + + + + + + +