• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
nbbaier

nbbaier

react-router-data-mode-starter

Remix of jxnblk/react-router-data-mode-starter
Public
Like
react-router-data-mode-starter
Home
Code
10
.vtignore
README.md
H
api.tsx
biome.json
client.tsx
deno.json
H
http.tsx
loader.ts
routes.tsx
types.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
https://nbbaier--d94f54b4f1474a298dfe2bea02c6a732.web.val.run
README.md

React Router Data Mode Starter

Minimal React Router starter example in "data mode" with server-side rendering for Val Town

View demo

How it works

The http.tsx file is the main server that responds with an HTML stream, using React Router. The HTML includes a <script type="module"> tag that loads the client.tsx file to hydrate the app with client-side routing provided by React Router in "data mode".

The routes are defined in routes and can include data loading and actions. The /about route includes a loader that fetches data from the api.tsx server, which returns a JSON response. The About page uses the useLoaderData hook to render the data from the loader in the page.

View more starters

HTTP
  • api.tsx
    nbbaier--d9…32.web.val.run
  • http.tsx
    nbbaier--40…d4.web.val.run
Code
.vtignoreREADME.md
H
api.tsx
biome.jsonclient.tsxdeno.json
H
http.tsx
loader.tsroutes.tsxtypes.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.