Skip to content

Commit 2abcfb2

Browse files
Update refs.mdx (#1127)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent dd580f9 commit 2abcfb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/concepts/refs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ This is useful when you want to access the element directly, but the element may
7979
```jsx
8080
function App() {
8181
const [show, setShow] = createSignal(false)
82-
const [element, setElement] = createSignal()
82+
let element!: HTMLParagraphElement
8383

8484
return (
8585
<div>
8686
<button onClick={() => setShow((isShown) => !isShown)}>Toggle</button>
8787

8888
<Show when={show()}>
89-
<p ref={setElement}>This is the ref element</p>
89+
<p ref={element}>This is the ref element</p>
9090
</Show>
9191
</div>
9292
)

0 commit comments

Comments
 (0)