Public
stevekrouse avatar
stevekrouse
dateme_browse
Script
Forked from pomdtr/dateme_browse
0
stevekrouse avatar
stevekrouse
dateme_home
Script
Forked from pomdtr/dateme_home
0
pomdtr avatar
pomdtr
example_component
Script
@jsxImportSource https://esm.sh/react
0
vawogbemi avatar
vawogbemi
dateme_faq
Script
Forked from stevekrouse/dateme_faq
0
stevekrouse avatar
stevekrouse
dateme_faq
Script
Forked from pomdtr/dateme_faq
0
pomdtr avatar
pomdtr
ssr_router
HTTP
SSR Framework for val.town Usage The router map url paths to component vals. Component vals must export a React Component as their default export: export default function() { <h1>Hello World!</h1> } Optionally, you can define an handler next to your component, allowing you to handle query params or form inputs. Use the ctx.render function to pass props to your component. export const handler: Handler = (ctx) => { const url = new URL(ctx.req.url); const params = new URLSearchParams(url.search); return ctx.render({ name: params.get("name") }); }; export default function(props: {name?: string}) { <h1>Hello { name || "World }!</h1> }
0
1
Next
Updated: February 27, 2024