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=435&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"(455ms)

xmasRedHamstermain.tsx2 matches

@stevekrouse•Updated 5 months ago
42
43 if (data.items && data.items.length > 0) {
44 // Sort pins by reaction count (as a measure of popularity)
45 const sortedPins = data.items.sort((a, b) => (b.reaction_counts?.like || 0) - (a.reaction_counts?.like || 0));
46 const mostPopularPin = sortedPins[0];
47

generateframeImagemain.tsx3 matches

@stevekrouse•Updated 5 months ago
1/** @jsxImportSource https://esm.sh/react */
2import React from "https://esm.sh/react";
3import { renderToString } from "https://esm.sh/react-dom/server";
4
5async function getWeather(latitude: number, longitude: number) {

seamlessBlushSwallowmain.tsx4 matches

@stevekrouse•Updated 5 months ago
1/** @jsxImportSource https://esm.sh/react */
2import Anthropic from "https://esm.sh/@anthropic-ai/sdk";
3import React, { useCallback, useEffect, useRef, useState } from "https://esm.sh/react";
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function debounce(func: Function, wait: number) {
61 }, [code, debouncedRenderShader]);
62
63 async function handleSubmit(e: React.FormEvent) {
64 e.preventDefault();
65 setLoading(true);

welcomingPinkAlligatormain.tsx5 matches

@stevekrouse•Updated 5 months ago
1/** @jsxImportSource https://esm.sh/react */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import React, { useState, useEffect, useRef, useCallback } from "https://esm.sh/react";
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function debounce(func: Function, wait: number) {
61 if (retryCount < 3) {
62 setRetryCount(prevCount => prevCount + 1);
63 handleSubmit(new Event('submit') as React.FormEvent, error.message);
64 } else {
65 cancelAnimationFrame(animationRef.current!);
79 }, [code, debouncedRenderShader, retryCount]);
80
81 async function handleSubmit(e: React.FormEvent, shaderErrorMessage?: string) {
82 if (e) e.preventDefault();
83 setLoading(true);

valtowntownmain.tsx3 matches

@maxm•Updated 6 months ago
1/** @jsxImportSource npm:react */
2import { serveRequest } from "https://esm.town/v/maxm/reqEvaltown";
3import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import { Hono } from "npm:hono";
6import React from "npm:react";
7import { renderToString } from "npm:react-dom/server";
8
9const { httpEndpoint } = extractValInfo(import.meta.url);

falDemoAppmain.tsx4 matches

@stevekrouse•Updated 6 months ago
1/** @jsxImportSource https://esm.sh/react */
2import { createFalClient } from "https://esm.sh/@fal-ai/client";
3import React, { useState } from "https://esm.sh/react";
4import { createRoot } from "https://esm.sh/react-dom/client";
5import { falProxyRequest } from "https://esm.town/v/stevekrouse/falProxyRequest";
6
10 const [loading, setLoading] = useState(false);
11
12 const generateImage = async (e?: React.FormEvent) => {
13 e?.preventDefault();
14 setLoading(true);

preciseAquamarineReptilemain.tsx6 matches

@stevekrouse•Updated 6 months ago
1/** @jsxImportSource https://esm.sh/react */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import React, { useState, useEffect } from "https://esm.sh/react";
4import { createRoot } from "https://esm.sh/react-dom/client";
5import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
39 }, [currentIndex, history]);
40
41 async function handleSubmit(e: React.FormEvent) {
42 e.preventDefault();
43 setLoading(true);

perseveringApricotSwordfishmain.tsx6 matches

@stevekrouse•Updated 6 months ago
1/** @jsxImportSource https://esm.sh/react */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import React, { useState } from "https://esm.sh/react";
4import { createRoot } from "https://esm.sh/react-dom/client";
5import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);

surpassingTealRoundwormmain.tsx6 matches

@stevekrouse•Updated 6 months ago
1/** @jsxImportSource https://esm.sh/react */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import React, { useState } from "https://esm.sh/react";
4import { createRoot } from "https://esm.sh/react-dom/client";
5import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
18 >(null);
19
20 async function handleSubmit(e: React.FormEvent) {
21 e.preventDefault();
22 setLoading(true);

cooperativeBronzeWildcatmain.tsx6 matches

@stevekrouse•Updated 6 months ago
1/** @jsxImportSource https://esm.sh/react */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import React, { useState } from "https://esm.sh/react";
4import { createRoot } from "https://esm.sh/react-dom/client";
5import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);

react-router-starter-remix-13 file matches

@jxnblk•Updated 1 day ago

reactHonoStarter4 file matches

@stfnsr•Updated 2 days ago