Skip to content

Commit

Permalink
Update basics.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyBluenotes authored Jul 18, 2024
1 parent add7d9f commit a51edbe
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/routes/concepts/components/basics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,16 @@ function MyComponent() {
const [count, setCount] = createSignal(0);
return (
<div>
<Show when={count() <= 5} fallback={<div>Count limit reached</div>}>
<p>Count: {count()}</p>
<button onClick={() => setCount((prev) => prev + 1)}>
Increment
</button>
</Show>
{count() > 5 ? (
<div>Count limit reached</div>
) : (
<>
<p>Count: {count()}</p>
<button onClick={() => setCount((prev) => prev + 1)}>
Increment
</button>
</>
)}
</div>
);
}
Expand Down

0 comments on commit a51edbe

Please sign in to comment.