Skip to content

Commit a86eac8

Browse files
committed
add if statement test
1 parent 05f8917 commit a86eac8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- message: Do not call hasContext except during component initialization.
2+
line: 5
3+
column: 9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script>
2+
import { hasContext, onMount } from "svelte"
3+
4+
onMount(() => {
5+
if (hasContext("answer")) {
6+
console.log("The answer exist")
7+
}
8+
})
9+
</script>

0 commit comments

Comments
 (0)