add missing export for hasContext (#5727)

pull/5729/head
Tan Li Hau 5 years ago committed by GitHub
parent 505eba84b9
commit ccc61a71d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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))

@ -7,6 +7,7 @@ export {
afterUpdate,
setContext,
getContext,
hasContext,
tick,
createEventDispatcher,
SvelteComponentDev as SvelteComponent

@ -0,0 +1,7 @@
<script>
import { hasContext } from 'svelte';
const has = hasContext('test');
</script>
<div>{has}</div>

@ -0,0 +1,11 @@
<script>
import { setContext } from 'svelte';
export let value = '';
if (value) {
setContext('test', value);
}
</script>
<slot></slot>

@ -0,0 +1,6 @@
export default {
html: `
<div>true</div>
<div>false</div>
`
};

@ -0,0 +1,12 @@
<script>
import Nested from "./Nested.svelte";
import Leaf from "./Leaf.svelte";
</script>
<Nested value="bar">
<Leaf />
</Nested>
<Nested>
<Leaf />
</Nested>
Loading…
Cancel
Save