You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/tutorial/01-svelte/07-lifecycle/01-onmount/README.md
+2
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,8 @@ Then, add a function that runs when the component mounts:
34
34
</script>
35
35
```
36
36
37
+
> In a [later exercise](bind-this), we'll learn how to get an element reference without using `document.querySelector`.
38
+
37
39
So far so good — you should see gently undulating colours in the shape of the Svelte logo. But there's one problem — the loop will continue even after the component has been destroyed. To fix that, we need to return a cleanup function from `onMount`:
0 commit comments