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=363&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 4509 results for "react"(429ms)

OpenTownieMessageTimer.tsx2 matches

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

OpenTownieMessagePart.tsx8 matches

@arfan•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
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 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 { MessagePart } from "./MessagePart.tsx";
4import { MessageTimer } from "./MessageTimer.tsx";

OpenTownieLogin.tsx2 matches

@arfan•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() {

OpenTownieLoadingSpinner.tsx2 matches

@arfan•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";
3
4export const LoadingSpinner = () => (

OpenTownieindex.tsx2 matches

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

OpenTownieImageUpload.tsx4 matches

@arfan•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));
74
75 {/* Expose the file input ref for external access */}
76 {React.cloneElement(<></>, { fileInputRef })}
77 </div>
78 );

OpenTownieErrorDisplay.tsx2 matches

@arfan•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";
3
4interface ErrorDisplayProps {

OpenTownieDirectoryTree.tsx4 matches

@arfan•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";
3
4// Type definitions
144 };
145
146 const handleCheckChange = (e: React.ChangeEvent<HTMLInputElement>) => {
147 onCheck(node.path, e.target.checked);
148 };
149
150 const handleNodeClick = (e: React.MouseEvent) => {
151 // Don't toggle checkbox if clicking on the expand/collapse arrow
152 if ((e.target as HTMLElement).classList.contains('toggle-expand')) {

OpenTownieCreateBranch.tsx3 matches

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

react-router-starter-remix-13 file matches

@jxnblk•Updated 1 day ago

reactHonoStarter4 file matches

@stfnsr•Updated 3 days ago