onClick does not work #716
|
/routes/index.tsx export default function Home() {
return (
<button
onClick={() => console.log("test")}
>
test
</button>
);
};No log is output when I click on the "button". |
Answered by
lucacasonato
Sep 8, 2022
Replies: 2 comments 1 reply
|
Click handlers and similar only work inside of island components, because only islands are shipped to the client. Please read https://fresh.deno.dev/docs/getting-started/adding-interactivity |
1 reply
Answer selected by
ru88s
|
It seems I didn't read the I encountered the same issue today when using the onClick event on an It turns out that This answer helped me, thank you! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Click handlers and similar only work inside of island components, because only islands are shipped to the client. Please read https://fresh.deno.dev/docs/getting-started/adding-interactivity