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=801&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 12399 results for "react"(4156ms)

OpenTownieuseProjectFiles.ts1 match

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

OpenTownieuseChatLogic.ts4 matches

@arfan•Updated 2 months 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

@arfan•Updated 2 months ago
4- [ ] Persistent threads
5 - [ ] Utils to help you revert to before or after messages or actions (related to commits)
6- [ ] Rebuild as React Router?
7- [ ] opentownie as a pr bot
8- [ ] 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

@arfan•Updated 2 months 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

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

OpenTownieProjects.tsx2 matches

@arfan•Updated 2 months 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

@arfan•Updated 2 months 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

@arfan•Updated 2 months 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

OpenTownieMessagePart.tsx8 matches

@arfan•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { type Message } from "https://esm.sh/@ai-sdk/react?dev&deps=react@18.2.0&react-dom@18.2.0";
3import ReactMarkdown from "https://esm.sh/react-markdown?dev&deps=react@18.2.0&react-dom@18.2.0";
4import { ImagePreview } from "./ImageUpload.tsx";
5
62 // Use the triple backtick syntax for code blocks
63 const codeBlock = "```" + language + "\n" + content + "\n```";
64 return <ReactMarkdown>{codeBlock}</ReactMarkdown>;
65};
66
67export function MessagePart({ part }: { part: NonNullable<Message["parts"]>[number] }) {
68 if (part.type === "text") return <ReactMarkdown>{part.text}</ReactMarkdown>;
69 if (part.type === "reasoning")
70 return (
74 </summary>
75 <div>
76 <ReactMarkdown>{part.reasoning}</ReactMarkdown>
77 {part.details && part.details.map((detail, index) => (
78 <div key={index} className="mt-2">
79 <ReactMarkdown>{detail.text}</ReactMarkdown>
80 </div>
81 ))}
106 // Handle the "think" tool specially
107 if (toolName === "think" && args.thought) {
108 return <ReactMarkdown>{args.thought}</ReactMarkdown>;
109 }
110

OpenTownieMessageItem.tsx2 matches

@arfan•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { MessagePart } from "./MessagePart.tsx";
4import { MessageTimer } from "./MessageTimer.tsx";

MiniAppStarter9 file matches

@moe•Updated 8 hours ago
Hono + React + Tailwind + Farcaster Mini App Starter Project
Discord-to-Linear

Discord-to-Linear4 file matches

@charmaine•Updated 1 day ago
Discord -> Linear ticket based on emoji reaction trigger
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