Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/routes/concepts/refs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ This is useful when you want to access the element directly, but the element may
```jsx
function App() {
const [show, setShow] = createSignal(false)
const [element, setElement] = createSignal()
let element!: HTMLParagraphElement

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

<Show when={show()}>
<p ref={setElement}>This is the ref element</p>
<p ref={element}>This is the ref element</p>
</Show>
</div>
)
Comment thread
LadyBluenotes marked this conversation as resolved.
Expand Down