Skip to content

Commit 0aa2f9e

Browse files
docs: minor addition to onMount usage (sveltejs#445)
* docs: minor addition to onMount usage * Update content/tutorial/01-svelte/07-lifecycle/01-onmount/README.md * Update content/tutorial/01-svelte/07-lifecycle/01-onmount/README.md --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 9581a34 commit 0aa2f9e

File tree

1 file changed

+2
-2
lines changed
  • content/tutorial/01-svelte/07-lifecycle/01-onmount

1 file changed

+2
-2
lines changed

content/tutorial/01-svelte/07-lifecycle/01-onmount/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: onMount
44

55
Every component has a _lifecycle_ that starts when it is created, and ends when it is destroyed. There are a handful of functions that allow you to run code at key moments during that lifecycle. The one you'll use most frequently is `onMount`, which runs after the component is first rendered to the DOM.
66

7-
In this exercise, we have a `<canvas>` that we'd like to animate, using the `paint` function in `gradient.js`. Begin by importing the function from `svelte`:
7+
In this exercise, we have a `<canvas>` that we'd like to animate, using the `paint` function in `gradient.js`. Begin by importing the `onMount` function from `svelte`:
88

99
```svelte
1010
/// file: App.svelte
@@ -14,7 +14,7 @@ In this exercise, we have a `<canvas>` that we'd like to animate, using the `pai
1414
</script>
1515
```
1616

17-
Then, add a function that runs when the component mounts:
17+
Then, add a callback that runs when the component mounts:
1818

1919
```svelte
2020
/// file: App.svelte

0 commit comments

Comments
 (0)