From a0b9f557588ba812fa729a7b1ac23ccfd4b225c2 Mon Sep 17 00:00:00 2001 From: Aral Roca Gomez Date: Tue, 31 Dec 2024 21:58:22 +0100 Subject: [PATCH] fix(example): fix ssr-modal example types (#695) --- examples/with-ssr-modal/src/pages/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/with-ssr-modal/src/pages/index.tsx b/examples/with-ssr-modal/src/pages/index.tsx index 86fec668..adbdf5a7 100644 --- a/examples/with-ssr-modal/src/pages/index.tsx +++ b/examples/with-ssr-modal/src/pages/index.tsx @@ -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 ? (