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/$1?q=react&page=57&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 16377 results for "react"(3189ms)

crm_OBUO_FARMSClientOrderForm.tsx4 matches

@eddie_walkโ€ขUpdated 4 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect } from 'https://esm.sh/react@18.2.0';
3import type { CreateOrderRequest, ApiResponse, Order, Product } from '../../shared/types.ts';
4
80 };
81
82 const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => {
83 const { name, value } = e.target;
84 setFormData(prev => ({
90 };
91
92 const handleSubmit = async (e: React.FormEvent) => {
93 e.preventDefault();
94 setIsSubmitting(true);

crm_OBUO_FARMSindex.tsx3 matches

@eddie_walkโ€ขUpdated 4 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from 'https://esm.sh/react@18.2.0?deps=react@18.2.0';
3import { createRoot } from 'https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0';
4import App from './components/App.tsx';
5

markdownBlogStarterLayout.tsx3 matches

@Gray_ciieโ€ขUpdated 4 days ago
1/** @jsxImportSource npm:react@18.2.0 */
2import type { ReactNode } from "npm:react@18.2.0";
3
4export function Layout({ children }: { children: ReactNode }) {
5 return (
6 <html lang="en">

markdownBlogStarterindex.tsx4 matches

@Gray_ciieโ€ขUpdated 4 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import Markdown from "https://esm.sh/react-markdown@9?deps=react@18.2.0";
3import { listFiles, readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
4import { renderToString } from "npm:react-dom@18.2.0/server";
5import { Layout } from "./Layout.tsx";
6
44}
45
46function html(children: React.ReactNode) {
47 return new Response(
48 renderToString(

createFileTreeREADME.md3 matches

@nbbaierโ€ขUpdated 4 days ago
7```ts
8import createFileTree from "https://esm.town/v/nbbaier/createFileTree/main.ts";
9const treeOutput = await createFileTree("std", "reactHonoStarter");
10console.log(treeOutput);
11```
12
13## Example Output
14The following is the output for [reactHonoStarter](https://www.val.town/x/std/reactHonoStarter) project
15```
16std/reactHonoStarter
17โ”œโ”€โ”€ backend
18โ”‚ โ””โ”€โ”€ index.ts

ChatuseAnthropicStream.tsx8 matches

@AIWBโ€ขUpdated 4 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import Anthropic, { MessageStreamEvent } from "https://esm.sh/@anthropic-ai/sdk";
3import React from "https://esm.sh/react@18.2.0";
4
5// External shared types
80
81export default function useAnthropicStream(config: AppConfig) {
82 const [status, setStatus] = React.useState<Status>("idle");
83 const [liveBlocks, setLiveBlocks] = React.useState<any[] | null>(null);
84 const abortRef = React.useRef<AbortController | null>(null);
85
86 /* Anthropic SDK instance โ€“ memoised so we don't recreate each render */
87 const anthropic = React.useMemo(() => {
88 if (!config.anthropicApiKey) return null;
89 return new Anthropic({
100
101 /* Abort helper */
102 const abort = React.useCallback(() => {
103 abortRef.current?.abort();
104 abortRef.current = null;
108
109 /* Main send/stream function โ€“ identical public contract */
110 const send = React.useCallback(
111 async (history: Message[], userText: string): Promise<AssistantMsg> => {
112 if (!anthropic) throw new Error("API key missing");

ChatStreamingChat.tsx3 matches

@AIWBโ€ขUpdated 4 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createParser, type ParsedEvent, type ReconnectInterval } from "https://esm.sh/eventsource-parser@2";
3import React, { useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4
5import { AnthropicStreamEvent, MCPPrompt } from "../../shared/types.ts";
247 };
248
249 const handleKeyDown = (e: React.KeyboardEvent) => {
250 if (showCommandPalette) {
251 const filteredPrompts = getFilteredPrompts();

ChatSettings.tsx2 matches

@AIWBโ€ขUpdated 4 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from "https://esm.sh/react@18.2.0";
3import { AppConfig, MCPServer } from "./App.tsx";
4import { testMCPServer } from "../utils/mcpTesting.ts";

ChatREADME.md1 match

@AIWBโ€ขUpdated 4 days ago
43โ”œโ”€โ”€ frontend/
44โ”‚ โ”œโ”€โ”€ index.html # Main HTML template
45โ”‚ โ”œโ”€โ”€ index.tsx # React app entry point
46โ”‚ โ”œโ”€โ”€ components/
47โ”‚ โ”‚ โ”œโ”€โ”€ App.tsx # Main app component

ChatMessage.tsx3 matches

@AIWBโ€ขUpdated 4 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4import { Message } from "./App.tsx";
5
8}
9
10const ShadowDomWrapper: React.FC<ShadowDomWrapperProps> = ({ html }) => {
11 const containerRef = useRef<HTMLDivElement>(null);
12 const shadowRef = useRef<ShadowRoot | null>(null);

reactHonoStarter4 file matches

@halfstackโ€ขUpdated 1 day ago

MiniAppStarter10 file matches

@moeโ€ขUpdated 1 day ago
Hono + React + Tailwind + Farcaster Mini App Starter Project
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