Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=react&page=1199&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=react

Returns an array of strings in format "username" or "username/projectName"

Found 16019 results for "react"(5400ms)

BlackJackApp.tsx4 matches

@stevekrouse•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
3import BlackjackTable from "./BlackjackTable.tsx";
4import BoozeButton from "./BoozeButton.tsx";
30}
31
32const App: React.FC = () => {
33 const [gameState, setGameState] = useState<GameState | null>(null);
34 const [message, setMessage] = useState<string>("No game in progress yet. Click Start!");
176 borderRadius: "8px",
177 }}>
178 <h1>Blackjack with React + Hono</h1>
179 <p>{message}</p>
180 {result && <p style={{ fontWeight: "bold", fontSize: "1.2em", color: result.includes("win") ? "green" : "red" }}>{result}</p>}

BlackJackBoozeButton.tsx3 matches

@stevekrouse•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3
4interface BoozeButtonProps {
7}
8
9const BoozeButton: React.FC<BoozeButtonProps> = ({ onBooze, disabled }) => {
10 return (
11 <div style={{ margin: "20px 0" }}>

blob_admin_toowiredREADME.md1 match

@toowired•Updated 2 months ago
6
7Versions 0-17 of this val were done with Hono and server-rendering.
8Versions 18+ were generated with Townie and use client-side React.
9
10To use this val, fork it to your account.

reactHonoStarterindex.tsx2 matches

@vawogbemi•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { App } from "./components/App.tsx";
4

reactHonoStarterREADME.md4 matches

@vawogbemi•Updated 2 months ago
1# React Hono Starter
2
3This app is a starter template for client-side React and server-side Hono.
4
5- **Remix** this starter template on the top right to get started.
7- The **entrypoint** is `/backend/index.ts`. That's the backend HTTP server, which also serves the all the frontend assets.
8
9- The **client-side entrypoint** is `/frontend/index.html`, which in turn imports `/frontend/index.tsx`, which in turn imports the React app from `/frontend/components/App.tsx`.
10
11[React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a fuller featured example project, with a SQLite database table, queries, client-side CSS and a favicon, and some shared code that runs on both client and server.

reactHonoStarterindex.html1 match

@vawogbemi•Updated 2 months ago
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>React Hono Val Town Starter</title>
7 <link rel="stylesheet" href="/public/style.css">
8 <link rel="icon" href="/public/favicon.svg" sizes="any" type="image/svg+xml">

reactHonoStarterApp.tsx3 matches

@vawogbemi•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
6 return (
7 <div>
8 <h1>Val Town React + Hono Starter</h1>
9 I've been clicked <button onClick={() => setClicked((c) => c + 1)}>{clicked}</button> times
10 </div>

cerebras_coderindex10 matches

@Shailesh•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0";
3import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter?deps=react@18.2.0,react-dom@18.2.0";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import STARTER_PROMPTS from "./starter-prompts.js";
6
30}: {
31 prompt: string;
32 setPrompt: React.Dispatch<React.SetStateAction<string>>;
33 handleSubmit: (e: React.FormEvent) => void;
34 handleStarterPromptClick: (promptItem: PromptItem) => void;
35}) {
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
120 const [projectId, setProjectId] = useState<number | null>(null);
174 }
175
176 async function handleSubmit(e: React.FormEvent | string) {
177 if (typeof e !== "string") {
178 e.preventDefault();
673 </div>
674 <div className="bg-white w-full h-full flex flex-col grow rounded-xl border-2 border-white overflow-hidden">
675 <React.Fragment key={iframeKey}>
676 <iframe
677 srcDoc={code}
679 className="w-full grow"
680 />
681 </React.Fragment>
682 </div>
683 </div>

ddg_chatmain.tsx8 matches

@wizos•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react */
2import React, { useEffect, useRef, useState } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4import ReactMarkdown from "https://esm.sh/react-markdown@9.0.1";
5import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter@15.5.0";
6import { oneDark } from "https://esm.sh/react-syntax-highlighter@15.5.0/dist/esm/styles/prism";
7import remarkGfm from "https://esm.sh/remark-gfm@4.0.0";
8
27 return (
28 <div style={role === "user" ? styles.userMessage : styles.assistantMessage}>
29 <ReactMarkdown
30 remarkPlugins={[remarkGfm]}
31 components={{
67 >
68 {content}
69 </ReactMarkdown>
70 </div>
71 );

filemain.tsx4 matches

@AIWB•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/preact@10.19.6 */
2import { type ClassValue, clsx } from "https://esm.sh/clsx@2.1.0";
3import { Copy, QrCode, Send, Shield, Users } from "https://esm.sh/lucide-preact@0.358.0";
4import { Peer } from "https://esm.sh/peerjs@1.5.4?bundle-deps";
5import { render } from "https://esm.sh/preact@10.19.6";
6import { useEffect, useRef, useState } from "https://esm.sh/preact@10.19.6/hooks";
7
8interface NDEFRecord {

MiniAppStarter10 file matches

@moe•Updated 6 hours ago
Hono + React + Tailwind + Farcaster Mini App Starter Project
hanabi

hanabi3 file matches

@jxnblk•Updated 10 hours ago
React Router for Hono in Val Town
effector
Write business logic with ease Meet the new standard for modern TypeScript development. Type-safe, reactive, framework-agnostic library to manage your business logic.
officialrajdeepsingh
Follow me if you learn more about JavaScript | TypeScript | React.js | Next.js | Linux | NixOS | Frontend Developer | https://linktr.ee/officialrajdeepsingh