Back to packages list

Vals using react-dom

Description from the NPM package:
React package for working with the DOM.
stevekrouse avatar
stevekrouse
react_http
Script
Client Side React Helper Example Usage /** @jsxImportSource https://esm.sh/react */ import { useState } from "https://esm.sh/react@18.2.0"; import react_http from "https://esm.town/v/stevekrouse/react_http?v=6"; export function App() { const [count, setCount] = useState(0); return ( <div> <h1>Example App</h1> <button onClick={() => setCount(count + 1)} className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" > {count} </button> </div> ); } export default () => react_http({ component: App, sourceURL: import.meta.url, head: `<meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <script src="https://cdn.tailwindcss.com"></script> <title>Example App</title>`, }); Gotchas Only use https imports The val with your React component will be imported in the browser. Thus, only use https imports in this val and any that it imports. Replace any npm: with https://esm.sh/ and everything should work great.
3
flxa avatar
flxa
ssr_react_mini
Script
Forked from stevekrouse/ssr_react_mini
0
tfayyaz avatar
tfayyaz
reacttldrawclient
Script
Forked from pomdtr/react_example_client
1
karlstens avatar
karlstens
azureWombat
HTTP
@jsxImportSource npm:react
0
westbrookdaniel avatar
westbrookdaniel
tomatoMarsupial
HTTP
@jsxImportSource npm:react
0
pomdtr avatar
pomdtr
tinybase_example_client
Script
@jsxImportSource https://esm.sh/react
0
pomdtr avatar
pomdtr
hydrate_island
Script
An interactive, runnable TypeScript val by pomdtr
1
pomdtr avatar
pomdtr
hydrate_islands
Script
Demo: @pomdtr/example_ssr Todo: [ ] only hydrate island when they enter the viewport
0
pomdtr avatar
pomdtr
ssr
Script
Todo [x] extract params from request paths using urlpatterns [ ] add a Form component [ ] add support for Layouts [ ] support other types url in router ("https://val.town/v/user/val" or "owner/val")
1
stevekrouse avatar
stevekrouse
ssr_react_mini
Script
Server-side Render React Mini Framework This is very experimental, more of a prototype of an architecture, than a true framework Example: https://www.val.town/v/stevekrouse/TodoApp
1
stevekrouse avatar
stevekrouse
annual_feedback
HTTP
@jsxImportSource https://esm.sh/react
0
stevekrouse avatar
stevekrouse
todoListScript
HTTP
An interactive, runnable TypeScript val by stevekrouse
0
89
Next