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=563&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 9297 results for "react"(856ms)

cerebras_coderindex10 matches

@jaballadares•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0";
3import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter?deps=react@18.2.0,react-dom@18.2.0";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import STARTER_PROMPTS from "./starter-prompts.js";
6
30}: {
31 prompt: string;
32 setPrompt: React.Dispatch<React.SetStateAction<string>>;
33 handleSubmit: (e: React.FormEvent) => void;
34 handleStarterPromptClick: (promptItem: PromptItem) => void;
35}) {
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
120 const [projectId, setProjectId] = useState<number | null>(null);
174 }
175
176 async function handleSubmit(e: React.FormEvent | string) {
177 if (typeof e !== "string") {
178 e.preventDefault();
673 </div>
674 <div className="bg-white w-full h-full flex flex-col grow rounded-xl border-2 border-white overflow-hidden">
675 <React.Fragment key={iframeKey}>
676 <iframe
677 srcDoc={code}
679 className="w-full grow"
680 />
681 </React.Fragment>
682 </div>
683 </div>

replicate_starterApp.tsx7 matches

@charmaine•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React from "https://esm.sh/react@18.2.0";
4
5function ImageGenerator() {
6 const [prompt, setPrompt] = React.useState("");
7 const [images, setImages] = React.useState<any>([]);
8 const [loading, setLoading] = React.useState(false);
9
10 const samplePrompts = [
31 };
32
33 React.useEffect(() => {
34 // Set a random prompt when component mounts
35 setPrompt(getRandomPrompt());

replicate_starterApp.tsx7 matches

@zeke•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React from "https://esm.sh/react@18.2.0";
4
5function ImageGenerator() {
6 const [prompt, setPrompt] = React.useState("");
7 const [images, setImages] = React.useState<any>([]);
8 const [loading, setLoading] = React.useState(false);
9
10 const samplePrompts = [
31 };
32
33 React.useEffect(() => {
34 // Set a random prompt when component mounts
35 setPrompt(getRandomPrompt());

applemain.tsx3 matches

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

markdownBlogStarterLayout.tsx3 matches

@charmaine•Updated 2 months 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">

unassumingMaroonEarthwormwebpage2 matches

@stevedylandev•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { html } from "https://esm.town/v/stevekrouse/html";
3import { renderToString } from "npm:react-dom@18.2.0/server";
4import getUrl from "./sdk";
5

karate_classesmain.tsx4 matches

@Dhruv1609•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { Hono } from "https://esm.sh/hono";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import {
5 BrowserRouter,
9 useNavigate,
10 useParams,
11} from "https://esm.sh/react-router-dom@6.11.2?deps=react@18.2.0";
12import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
13import { z } from "https://esm.sh/zod@3.21.4";
14import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe";

splendidCrimsonScorpionmain.tsx5 matches

@hold•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
14 };
15
16 const handleRegister = (e: React.FormEvent) => {
17 e.preventDefault();
18 if (password !== confirmPassword) {
23 };
24
25 const handleLogin = (e: React.FormEvent) => {
26 e.preventDefault();
27 setIsLoggedIn(true);

virtuousJadeSlugmain.tsx3 matches

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

PetconREADME.md1 match

@Zeeshanshaikh2•Updated 2 months ago
1import React, { useState } from "react";
2import { Card, CardContent } from "@/components/ui/card";
3import { Button } from "@/components/ui/button";

IClickWolf4 file matches

@vtTestLocal•Updated 1 day ago
Starter template with client-side React & Hono server

vt-discord4 file matches

@boucher•Updated 5 days ago
Starter template with client-side React & Hono server
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