Skip to content

Commit dbd4617

Browse files
authored
docs: correct toggle function in lifecycle hooks example (#15486)
1 parent 81480c4 commit dbd4617

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

documentation/docs/06-runtime/03-lifecycle-hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ With runes, we can use `$effect.pre`, which behaves the same as `$effect` but ru
147147
}
148148
149149
function toggle() {
150-
toggleValue = !toggleValue;
150+
theme = theme === 'dark' ? 'light' : 'dark';
151151
}
152152
</script>
153153

0 commit comments

Comments
 (0)