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/image-url.jpg%20%22Optional%20title%22?q=react&page=150&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 11618 results for "react"(1307ms)

vectorsroutes.tsx9 matches

@jxnblk•Updated 6 days ago
1/** @jsxImportSource https://esm.sh/react@19 */
2import React from "https://esm.sh/react@19";
3import { useLoaderData, Link, Outlet } from "https://esm.sh/react-router@7";
4
5// provide the full URL so that both the client and server can fetch
6const API_URL = "https://react-router-hono.val.run/api";
7
8function HTML ({ children }: {
9 children: React.ReactNode;
10}) {
11 return (
12 <html lang="en">
13 <head>
14 <title>React Router Hono Starter</title>
15 </head>
16 <body>
26 <div>
27 <header>
28 <div>React Router Hono Starter</div>
29 <nav>
30 <ul>
40 <Outlet />
41 <footer>
42 <a href="https://val.town/x/jxnblk/react-router-hono-starter">Remix it on Val Town</a>
43 </footer>
44 </div>
48
49function Home () {
50 const [count, setCount] = React.useState(0);
51 return (
52 <div>

my-first-valOnboardingPage.tsx5 matches

@dieberuo•Updated 6 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from "https://esm.sh/react@18.2.0";
3import type { User } from "../../shared/types.ts";
4
7}
8
9const OnboardingPage: React.FC<OnboardingPageProps> = ({ onUserCreated }) => {
10 const [step, setStep] = useState<number>(1);
11 const [formData, setFormData] = useState({
20 const [isLoading, setIsLoading] = useState<boolean>(false);
21
22 const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => {
23 const { name, value } = e.target;
24 setFormData(prev => ({
51 };
52
53 const handleSubmit = async (e: React.FormEvent) => {
54 e.preventDefault();
55 setIsLoading(true);

my-first-valApp.tsx3 matches

@dieberuo•Updated 6 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
3import HomePage from "./HomePage.tsx";
4import MealsPage from "./MealsPage.tsx";
20}
21
22const App: React.FC = () => {
23 const [currentPage, setCurrentPage] = useState<string>("home");
24 const [user, setUser] = useState<User | null>(null);

my-first-valindex.tsx3 matches

@dieberuo•Updated 6 days 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";
4import App from "./components/App.tsx";
5

my-first-valREADME.md1 match

@dieberuo•Updated 6 days ago
27## Technology Stack
28
29- **Frontend**: HTML, CSS, TypeScript with React
30- **Styling**: TailwindCSS
31- **Backend**: Hono framework for API routing

mini-remix-soundsound.tsx2 matches

@probablycorey•Updated 6 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useRef, useState } from "https://esm.sh/react@18.2.0";
3import { defineAction, defineLoader, render } from "./render.ts";
4

mini-remix-soundreact.tsx2 matches

@probablycorey•Updated 6 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useState } from "https://esm.sh/react@18.2.0";
3import { defineAction, defineLoader, Form, render, useActionData, useLoaderData } from "./render.ts";
4

untitled-1352index.html9 matches

@gmcabrita•Updated 6 days ago
9 <script src="https://cdn.tailwindcss.com"></script>
10
11 <!-- Load React, ReactDOM, and Babel -->
12 <script
13 crossorigin
14 src="https://unpkg.com/react@18/umd/react.production.min.js"
15 ></script>
16 <script
17 crossorigin
18 src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
19 ></script>
20 <script
45 // Weight Tracker Component
46 const WeightTracker = () => {
47 const [weightData, setWeightData] = React.useState([]);
48 const [stats, setStats] = React.useState(null);
49 const [isLoading, setIsLoading] = React.useState(false);
50 const [error, setError] = React.useState(null);
51 const [fileName, setFileName] = React.useState('');
52
53 const handleFileUpload = (event) => {
492
493 // Render the App
494 const root = ReactDOM.createRoot(document.getElementById('root'));
495 root.render(<WeightTracker />);
496 </script>

FullstackStarterindex.html1 match

@wolf•Updated 6 days ago
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>React Hono Val Town Starter</title>
7 <script src="https://cdn.tailwindcss.com"></script>
8 <link rel="icon" href="/public/favicon.svg" sizes="any" type="image/svg+xml">

untitled-5961FileUpload.tsx8 matches

@toowired•Updated 6 days ago
1// components/FileUpload.tsx - Advanced file upload with drag-and-drop and progress
2import React, { useCallback, useRef, useState } from "react";
3import { useFileProcessor } from "../hooks/useFileProcessor";
4import { ProcessedDocument } from "../lib/types";
14}
15
16export const FileUpload: React.FC<FileUploadProps> = ({
17 onFileProcessed,
18 onTextProcessed,
72
73 // Drag and drop handlers
74 const handleDragEnter = useCallback((e: React.DragEvent) => {
75 e.preventDefault();
76 e.stopPropagation();
78 }, []);
79
80 const handleDragLeave = useCallback((e: React.DragEvent) => {
81 e.preventDefault();
82 e.stopPropagation();
84 }, []);
85
86 const handleDragOver = useCallback((e: React.DragEvent) => {
87 e.preventDefault();
88 e.stopPropagation();
89 }, []);
90
91 const handleDrop = useCallback((e: React.DragEvent) => {
92 e.preventDefault();
93 e.stopPropagation();
119 }, [maxFiles, validateFile, handleFileProcessing]);
120
121 const handleFileInputChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
122 const files = e.target.files ? Array.from(e.target.files) : [];
123 handleFileSelection(files);
125
126 // Paste handling for text area
127 const handleTextPaste = useCallback((e: React.ClipboardEvent) => {
128 const pastedText = e.clipboardData.getData("text");
129 if (pastedText && !textInput) {

reactHonoExample9 file matches

@johnroyall•Updated 45 mins ago

reactHonoStarter4 file matches

@johnroyall•Updated 1 hour ago
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