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=1&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 12532 results for "react"(890ms)

blob_adminmain.tsx2 matches

@codeanand•Updated 24 mins ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { type Context, Hono } from "https://esm.sh/hono";
3import { debounce } from "https://esm.sh/lodash-es";
4import React, { ReactNode, useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
5import { parseProject, serveFile } from "https://esm.town/v/std/utils/index.ts";
6import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe";

blob_adminapp.tsx5 matches

@codeanand•Updated 24 mins ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { useDropzone } from "https://esm.sh/react-dropzone?deps=react@18.2.0,react-dom@18.2.0";
4import React, { ReactNode, useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
5import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton";
6
7interface TooltipProps {
8 children: ReactNode;
9 content: string;
10}

MCPMCPClient.tsx1 match

@c15r•Updated 1 hour ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3/**

MCPChatInterface.tsx3 matches

@c15r•Updated 1 hour ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useRef, useEffect } from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3import { Message } from "./App.tsx";
4
22 }, [messages]);
23
24 const handleSubmit = (e: React.FormEvent) => {
25 e.preventDefault();
26 if (input.trim() && !isLoading) {

MCPApiKeyInput.tsx2 matches

@c15r•Updated 1 hour ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3
4interface ApiKeyInputProps {

MCPApp.tsx2 matches

@c15r•Updated 1 hour ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect, useRef } from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3import { MCPClient } from "./MCPClient.tsx";
4import { ApiKeyInput } from "./ApiKeyInput.tsx";

MCPindex.tsx3 matches

@c15r•Updated 1 hour 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,react-dom@18.2.0";
4import { App } from "./components/App.tsx";
5

dateme-2README.md1 match

@stevekrouse•Updated 2 hours ago
31Once you've authenticated, let people submit that form and then later also edit it. We'll need a notion of being logged in and logging out
32
33import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe" Wrap & export the main HTTP handler: export default lastlogin(handler). In the HTTP handler, retrieve the user's email: const email = request.headers.get("X-LastLogin-Email") If email, show that user's content, and a logout link to "/auth/logout"; if no email, show login options. import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton" Use the React Component, optionally supplying the text attribute Add "via LastLogin" underneat LoginWithGoogleButton, centered, secondary text, linking to https://lastlogin.io/ Pass the email from the server to the client-side code if using React hydration or similar techniques.
34```

cerebras_coderindex.ts10 matches

@Downchuck•Updated 3 hours 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}) {
84
85function App() {
86 const previewRef = React.useRef<HTMLDivElement>(null);
87 const [prompt, setPrompt] = useState("");
88 const [projectId, setProjectId] = useState<number | null>(null);
142 }
143
144 async function handleSubmit(e: React.FormEvent | string) {
145 if (typeof e !== "string") {
146 e.preventDefault();
538 </div>
539 <div className="bg-white w-full h-full flex flex-col grow rounded-xl border-2 border-white overflow-hidden">
540 <React.Fragment key={iframeKey}>
541 <iframe
542 srcDoc={code}
544 className="w-full grow"
545 />
546 </React.Fragment>
547 </div>
548 </div>

tourguideindex.tsx4 matches

@neverstew•Updated 5 hours 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
6// Initialize the React app
7const container = document.getElementById('root');
8if (container) {

reactHonoStarter4 file matches

@lightweight•Updated 7 hours ago

reactHonoStarter4 file matches

@std•Updated 9 hours 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