Skip to content

Commit 298f539

Browse files
committed
add test
1 parent 917587f commit 298f539

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- message: Do not call setContext except during component initialization.
2+
line: 5
3+
column: 7
4+
suggestions: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script>
2+
import { setContext, onMount } from "svelte"
3+
const something = () => {
4+
const inner = () => {
5+
setContext("answer", 42)
6+
}
7+
inner()
8+
}
9+
10+
something()
11+
</script>
12+
13+
{#if something()}
14+
<button>Click Me</button>
15+
{/if}

0 commit comments

Comments
 (0)