Merge branch 'master' into customStyleTag

pull/5639/head
Ivan Hofer 5 years ago
commit 9c826116cd

@ -1,5 +1,9 @@
# Svelte changelog # Svelte changelog
## Unreleased
* Actually export `hasContext` ([#5726](https://github.com/sveltejs/svelte/issues/5726))
## 3.30.0 ## 3.30.0
* Add a typed `SvelteComponent` interface ([#5431](https://github.com/sveltejs/svelte/pull/5431)) * Add a typed `SvelteComponent` interface ([#5431](https://github.com/sveltejs/svelte/pull/5431))

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

@ -7,6 +7,7 @@ export {
afterUpdate, afterUpdate,
setContext, setContext,
getContext, getContext,
hasContext,
tick, tick,
createEventDispatcher, createEventDispatcher,
SvelteComponentDev as SvelteComponent 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