Skip to content

Commit

Permalink
fix: classList example
Browse files Browse the repository at this point in the history
  • Loading branch information
parker-codes authored and atilafassina committed Jul 10, 2024
1 parent f9812c0 commit 1dc5611
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/concepts/components/class-style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ When the value is `true`, the class is applied; when `false`, it is removed.
const [current, setCurrent] = createSignal("foo");

<button
classList={current() === "foo" ? "selected" : ""}
classList={{ "selected" : current() === "foo" }}
onClick={() => setCurrent("foo")}
>
foo
Expand Down

0 comments on commit 1dc5611

Please sign in to comment.