Skip to content

Commit

Permalink
fix(example): fix ssr-modal example types (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Dec 31, 2024
1 parent cce9a9e commit a0b9f55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/with-ssr-modal/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ function openModal() {
});
}

function processAnswer(e: ClickEvent, value = 'yes') {
function processAnswer(e: MouseEvent, value = 'yes') {
const id = (e.target as HTMLButtonElement).dataset.id;
const isCorrect = questions.find((q) => q.id === Number(id)).answer === value;
const isCorrect =
questions.find((q) => q.id === Number(id))?.answer === value;

renderComponent({
element: isCorrect ? (
<p id="content" class="correct">
Expand Down

0 comments on commit a0b9f55

Please sign in to comment.