Example Full-stack Todo List App with React SSR + Client-side hydration & sqlite

Requires you to put the React component in another val, in this case: https://www.val.town/v/stevekrouse/TodoApp

1
2
3
import ssr_hydrate from "https://esm.town/v/stevekrouse/ssr_hydrate_react";
export default ssr_hydrate("stevekrouse", "TodoApp");
1
2
3
4
5
6
7
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import { jsx as _jsx } from "https://esm.sh/react/jsx-runtime";
import { TodoApp } from "https://esm.town/v/stevekrouse/TodoApp";
const root = createRoot(document.getElementById("app"));
let initialTodos = await fetch("https://stevekrouse-todo_list.web.val.run/todos").then(r => r.json());
root.render(_jsx(TodoApp, { initialTodos: initialTodos }));
1
Next