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: src/routes/reference/lifecycle/on-mount.mdx
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ order: 5
4
4
---
5
5
6
6
Registers a method that runs after initial rendering is done and the elements are mounted to the page.
7
-
Ideal for using [refs](/reference/jsx-attributes/ref) and managing other one-time setup that requires the
7
+
Ideal for using [refs](/reference/jsx-attributes/ref) and managing other one-time setup.
8
8
9
9
```tsx
10
10
import { onMount } from"solid-js"
@@ -16,11 +16,11 @@ function onMount(fn: () => void): void
16
16
This is an alias for an effect that is non-tracking, meaning that it is equivalent to a [`createEffect`](/reference/basic-reactivity/create-effect) with no dependencies.
17
17
18
18
```tsx
19
-
// example that shoes how to use onMount to get a ref to an element
19
+
// example that shows how to use onMount to get a reference to an element
20
20
import { onMount } from"solid-js"
21
21
22
22
function MyComponent() {
23
-
let ref:HTMLDivElement
23
+
let ref:HTMLButtonElement
24
24
25
25
// when the component is mounted, the button will be disabled
0 commit comments