Skip to content

Commit a51edbe

Browse files
Update basics.mdx
1 parent add7d9f commit a51edbe

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/routes/concepts/components/basics.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,16 @@ function MyComponent() {
129129
const [count, setCount] = createSignal(0);
130130
return (
131131
<div>
132-
<Show when={count() <= 5} fallback={<div>Count limit reached</div>}>
133-
<p>Count: {count()}</p>
134-
<button onClick={() => setCount((prev) => prev + 1)}>
135-
Increment
136-
</button>
137-
</Show>
132+
{count() > 5 ? (
133+
<div>Count limit reached</div>
134+
) : (
135+
<>
136+
<p>Count: {count()}</p>
137+
<button onClick={() => setCount((prev) => prev + 1)}>
138+
Increment
139+
</button>
140+
</>
141+
)}
138142
</div>
139143
);
140144
}

0 commit comments

Comments
 (0)