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/?q=react&page=485&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 9479 results for "react"(1228ms)

FixItWandSignIn.tsx3 matches

@wolf•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@19.0.0 */
2import { useState } from "https://esm.sh/react@19.0.0";
3
4type SignInState = "idle" | "loading" | "sent";
8 const [state, setState] = useState<SignInState>("idle");
9
10 const handleSubmit = async (e: React.FormEvent) => {
11 e.preventDefault();
12

imagegeneratormain.tsx3 matches

@youssef1527•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4
5// Game constants

OpenTownieuseProjectFiles.ts1 match

@k7d•Updated 1 month ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2import { fetchProjectFiles } from "../utils/api.ts";
3

OpenTownieuseChatLogic.ts4 matches

@k7d•Updated 1 month ago
1import { useChat } from "https://esm.sh/@ai-sdk/react?dev&deps=react@18.2.0&react-dom@18.2.0";
2import React, { useCallback, useMemo, useRef, useState } from "https://esm.sh/react@18.2.0?dev";
3import { playBellSound } from "../utils/soundEffects.ts";
4
99 }, [stop, pendingMessageId, soundEnabled]);
100
101 React.useEffect(() => {
102 customStopRef.current = handleStop;
103 }, [handleStop]);
104
105 React.useEffect(() => {
106 (window as any).customStopRef = customStopRef;
107 }, []);

OpenTownieTODOs.md1 match

@k7d•Updated 1 month ago
11- [ ] make it one click to branch off like old jp townie demos
12- [ ] Figure out a convention to teach in the anthropic prompt mod where the LLM always checks the readme for the scope (if not provided) and keeps it up to take with every change
13- [ ] Rebuild as React Router?
14- [ ] opentownie as a pr bot
15- [ ] give it the ability to see its own client-side and server-side logs by building a middleware that shoves them into a SQL light database date and then give it a tool to access them or use our trpc API in that tool

OpenTowniesystem_prompt.txt9 matches

@k7d•Updated 1 month ago
107- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
108- For persistence, use Val Town SQLite or Blob storage with `import.meta.url` for keys/table names
109- **React Configuration:** When using React libraries, pin versions with `?deps=react@18.2.0,react-dom@18.2.0` and include the `@jsxImportSource` pragma
110- When facing client-side render issues, check if all React dependencies are pinned to the same version
111- **Styling:** Default to using TailwindCSS via `<script src="https://cdn.twind.style" crossorigin></script>` unless otherwise specified
112
220
221### Frontend Best Practices
222- Structure as a standard client-side React app
223- Use SVG for favicons (Val Town only supports text files)
224- Separate components into individual files
225- Access bootstrapped data from `window.__INITIAL_DATA__`
226- Use React 18.2.0 consistently in all imports and the `@jsxImportSource` pragma
227- Follow the React component pattern from the example project
228- Handle API calls properly with proper error catching
229
247 - Always run table creation before querying
248
2493. **React Configuration:**
250 - All React dependencies must be pinned to 18.2.0
251 - Always include `@jsxImportSource https://esm.sh/react@18.2.0` at the top of React files
252 - Rendering issues often come from mismatched React versions
253
2544. **File Handling:**

OpenTownieREADME.md1 match

@k7d•Updated 1 month ago
46
47OpenTownie is built with:
48- React frontend with TypeScript
49- Hono API server backend
50- Tailwind CSS for styling

OpenTownieProjects.tsx2 matches

@k7d•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
3
4// Component for the loading spinner

OpenTownieProjectFiles.tsx2 matches

@k7d•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { DirectoryTree } from "./DirectoryTree.tsx";
4import { LoadingSpinner } from "./LoadingSpinner.tsx";

OpenTownieMessageTimer.tsx2 matches

@k7d•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0?dev";
3
4// Utility to format milliseconds into a readable time string

reactHonoStarter4 file matches

@texoport•Updated 12 hours ago

new_website

@wolf•Updated 2 days ago
Starter template with client-side React & Hono server
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