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=372&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 4495 results for "react"(466ms)

OpenTownie_1742929529007App.tsx3 matches

@dcm31•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
3import React, { useState } from "https://esm.sh/react@18.2.0?dev";
4import { Chat } from "./Chat.tsx";
5import { Login } from "./Login.tsx";

OpenTownie_1742929529007BranchControl.tsx3 matches

@dcm31•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useEffect, useState } from "https://esm.sh/react@18.2.0?dev";
3import { CreateBranch } from "./CreateBranch.tsx";
4
84
85 // Handle branch selection change
86 const handleBranchChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
87 const newBranchId = e.target.value;
88 setBranchId(newBranchId);

OpenTownie_1742929529007Chat.tsx9 matches

@dcm31•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useChat } 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 { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
5import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0?dev";
6import { playBellSound } from "../utils/soundEffects.ts";
7import { BranchControl } from "./BranchControl.tsx";
200 });
201
202 const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
203 e.preventDefault();
204 const validImages = images.filter((img): img is string => typeof img === "string");
213
214 // Keep track of the most recent assistant message that's still streaming
215 const pendingMessageId = React.useMemo(() => {
216 if (!running) return null;
217 // Find the most recent assistant message that doesn't have an end time
222
223 // Custom stop handler that also handles UI elements (timer and spinner)
224 const handleStop = React.useCallback(() => {
225 // Call the original stop function
226 stop();
243
244 // Update the custom stop function ref when the dependencies change
245 React.useEffect(() => {
246 customStopRef.current = handleStop;
247 }, [handleStop]);

OpenTownie_1742929529007CreateBranch.tsx3 matches

@dcm31•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useState } from "https://esm.sh/react@18.2.0?dev";
3
4interface CreateBranchProps {
25 };
26
27 const handleSubmit = async (e: React.FormEvent) => {
28 e.preventDefault();
29

OpenTownie_1742929529007ImageUpload.tsx7 matches

@dcm31•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useRef, useState } from "https://esm.sh/react@18.2.0?dev";
3
4// Maximum number of images that can be uploaded
15
16 // Handle file selection
17 const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
18 if (e.target.files) {
19 processFiles(Array.from(e.target.files));
66
67 // Handle drag events
68 const handleDragEnter = (e: React.DragEvent) => {
69 e.preventDefault();
70 e.stopPropagation();
72 };
73
74 const handleDragLeave = (e: React.DragEvent) => {
75 e.preventDefault();
76 e.stopPropagation();
78 };
79
80 const handleDragOver = (e: React.DragEvent) => {
81 e.preventDefault();
82 e.stopPropagation();
83 };
84
85 const handleDrop = (e: React.DragEvent) => {
86 e.preventDefault();
87 e.stopPropagation();

OpenTownie_1742929529007index.tsx2 matches

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

OpenTownie_1742929529007Login.tsx2 matches

@dcm31•Updated 1 month ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
3
4export function Login() {

OpenTownie_1742929529007MessagePart.tsx6 matches

@dcm31•Updated 1 month 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
6export function MessagePart({ part }: { part: NonNullable<Message["parts"]>[number] }) {
7 if (part.type === "text") return <ReactMarkdown>{part.text}</ReactMarkdown>;
8 if (part.type === "reasoning")
9 return (
13 </summary>
14 <div>
15 <ReactMarkdown>{part.reasoning}</ReactMarkdown>
16 {part.details && part.details.map((detail, index) => (
17 <div key={index} className="mt-2">
18 <ReactMarkdown>{detail.text}</ReactMarkdown>
19 </div>
20 ))}

OpenTownie_1742929529007Projects.tsx2 matches

@dcm31•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

OpenTownie_1742929529007README.md1 match

@dcm31•Updated 1 month ago
8
9- [ ] Give it all the code (except maybe .txt files) as initial context (like cursor sonnet max)
10- [ ] Rebuild as React Router?
11- [ ] Persistent threads?
12- [ ] Have it default to creating a new branch off main and then embedding and iframe to the resulting http val and give you a link to a pr opening url

react-router-starter-remix-13 file matches

@jxnblk•Updated 1 day ago

reactHonoStarter4 file matches

@stfnsr•Updated 2 days ago