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=736&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 8591 results for "react"(1999ms)

summarizeHnmain.tsx6 matches

@prashamtrivedi•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react */
2import React, { useState, useEffect } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4import { GoogleGenerativeAI } from "https://esm.sh/@google/generative-ai";
5
221 if (root) {
222 try {
223 console.log("Rendering React app");
224 createRoot(root).render(<App />);
225 console.log("React app rendered");
226 } catch (error) {
227 console.error("Error rendering React app:", error);
228 root.innerHTML = `<div class="error">Error rendering the application. Please check the console for more details.</div>`;
229 }

cerebras_codermain.tsx10 matches

@the_samoudi•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
5import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
6import { STARTER_PROMPTS } from "https://esm.town/v/the_samoudi/cerebras_coder_prompts";
7
18}: {
19 prompt: string;
20 setPrompt: React.Dispatch<React.SetStateAction<string>>;
21 handleSubmit: (e: React.FormEvent) => void;
22 handleStarterPromptClick: (promptItem: PromptItem) => void;
23}) {
121
122function App() {
123 const previewRef = React.useRef<HTMLDivElement>(null);
124 const [prompt, setPrompt] = useState("");
125 const [projectId, setProjectId] = useState<number | null>(null);
178 }
179
180 async function handleSubmit(e: React.FormEvent | string) {
181 if (typeof e !== "string") {
182 e.preventDefault();
695 </div>
696 <div className="w-full h-full flex flex-col grow rounded-xl border-2 border-white">
697 <React.Fragment key={iframeKey}>
698 <iframe
699 srcDoc={code}
701 className="w-full h-full grow"
702 />
703 </React.Fragment>
704 </div>
705 </div>

hardworkingLimeCheetahmain.tsx10 matches

@stevekrouse•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter";
5import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
6 import { STARTER_PROMPTS } from "https://esm.town/v/stevekrouse/cerebras_coder_prompts";
7
19}: {
20 prompt: string;
21 setPrompt: React.Dispatch<React.SetStateAction<string>>;
22 handleSubmit: (e: React.FormEvent) => void;
23 handleStarterPromptClick: (promptItem: PromptItem) => void;
24}) {
122
123function App() {
124 const previewRef = React.useRef<HTMLDivElement>(null);
125 const [prompt, setPrompt] = useState("");
126 const [projectId, setProjectId] = useState<number | null>(null);
179 }
180
181 async function handleSubmit(e: React.FormEvent | string) {
182 if (typeof e !== "string") {
183 e.preventDefault();
696 </div>
697 <div className="w-full h-full flex flex-col grow rounded-xl border-2 border-white">
698 <React.Fragment key={iframeKey}>
699 <iframe
700 srcDoc={code}
702 className="w-full h-full grow"
703 />
704 </React.Fragment>
705 </div>
706 </div>

calmRoseCaterpillarmain.tsx4 matches

@hameed•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import mermaid from "https://esm.sh/mermaid@10.6.1";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5
6// Spinner Component
58 }, [mermaidDiagram]);
59
60 const handleSubmit = async (e: React.FormEvent) => {
61 e.preventDefault();
62 setError("");

postMessageButtonGamemain.tsx3 matches

@edenh•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {

blob_adminmain.tsx5 matches

@stevekrouse1•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { Hono } from "https://esm.sh/hono";
3import { debounce } from "https://esm.sh/lodash-es";
4import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
5import { useDropzone } from "https://esm.sh/react-dropzone?deps=react@18.2.0,react-dom@18.2.0";
6import React, { ReactNode, useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
7import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe";
8import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton";
9
10interface TooltipProps {
11 children: ReactNode;
12 content: string;
13}

blob_adminREADME.md1 match

@stevekrouse1•Updated 4 months ago
6
7Versions 0-17 of this val were done with Hono and server-rendering.
8Versions 18+ were generated with Townie and use client-side React.
9
10To use this val, fork it to your account.

grandLimeTurkeymain.tsx2 matches

@nareach•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 **/
2import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
3
4export default (req: Request) => {

intelligentTanPelicanmain.tsx2 matches

@mobile247•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 **/
2import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
3
4export default (req: Request) => {

randoDiscmain.tsx5 matches

@ashryanio•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { AnimatePresence, motion } from "https://esm.sh/framer-motion?deps=react@18.2.0,react-dom@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import React, { useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
5
6function ErrorMessage({ message }) {
441}
442
443class ErrorBoundary extends React.Component {
444 constructor(props) {
445 super(props);

vt-discord4 file matches

@boucher•Updated 2 days ago
Starter template with client-side React & Hono server

diceRollerUI1 file match

@dcm31•Updated 2 days ago
A web-based dice roller using React on Val Town
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