In the Hono Discord server, "Stoke" asked about how to use query parameters in his client side JavaScript.
In this demo, I show two ways to enable this:
- Using the Hono
html
helper to have the JavaScript inline with HTML. - Creating JSX components to separate the JavaScript into separate files.
This screen recording will demonstrate both approaches. Sorry, I wasn't able to cleanup the video.
To see code changes, see each of these commits.
- NOTE: In the video, I did not go over the changes to the
tsconfig.json
file.strict
was disabled because the original poster seemed to prefer plain JavaScript.lib
was changed so TypeScript would recognizedocument
and other browser APIs.
npm install
npm run dev