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/$%7Bart_info.art.src%7D?q=react&page=119&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 9549 results for "react"(2109ms)

stevensDemo.cursorrules9 matches

@maartenpo•Updated 1 week ago
199- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
200- For persistence, use Val Town SQLite or Blob storage with `import.meta.url` for keys/table names
201- **React Configuration:** When using React libraries, pin versions with `?deps=react@18.2.0,react-dom@18.2.0` and include the `@jsxImportSource` pragma
202- When facing client-side render issues, check if all React dependencies are pinned to the same version
203- **Styling:** Default to using TailwindCSS via `<script src="https://cdn.twind.style" crossorigin></script>` unless otherwise specified
204
262
263### Frontend Best Practices
264- Structure as a standard client-side React app
265- Use SVG for favicons (Val Town only supports text files)
266- Separate components into individual files
267- Access bootstrapped data from `window.__INITIAL_DATA__`
268- Use React 18.2.0 consistently in all imports and the `@jsxImportSource` pragma
269- Follow the React component pattern from the example project
270- Handle API calls properly with proper error catching
271
289 - Always run table creation before querying
290
2913. **React Configuration:**
292 - All React dependencies must be pinned to 18.2.0
293 - Always include `@jsxImportSource https://esm.sh/react@18.2.0` at the top of React files
294 - Rendering issues often come from mismatched React versions
295
2964. **File Handling:**

stevensDemoApp.tsx5 matches

@maartenpo•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, {
3 useState,
4 useEffect,
5 useCallback,
6 useMemo,
7} from "https://esm.sh/react@18.2.0";
8import { type Memory } from "../../shared/types.ts";
9import { ASSETS, SCENE_POSITIONS, SOURCE_TYPES } from "./assets.ts";
165 }, [fetchMemories]);
166
167 const handleAddMemory = async (e: React.FormEvent) => {
168 e.preventDefault();
169 if (!newMemoryText.trim()) return;
220 };
221
222 const handleUpdateMemory = async (e: React.FormEvent) => {
223 e.preventDefault();
224 if (!editingMemory || !editingMemory.text.trim()) return;

git_jiggymain.tsx3 matches

@wolf•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react */
2import React, { useEffect, useRef, useState } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5const SCALES = {

fitnessmain.tsx4 matches

@omar1•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useRef } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import {
5 Barbell,
8 Calendar,
9 Dumbbell
10} from "https://esm.sh/phosphor-react@2.0.0";
11
12// Predefined exercise dictionary (unchanged from previous implementation)

strategistmain.tsx3 matches

@omar1•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect, useRef } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function TypewriterEffect({ text, speed = 20, onComplete }) {

flashcardsmain.tsx3 matches

@omar1•Updated 1 week 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
5interface Flashcard {

datamain.tsx19 matches

@omar1•Updated 1 week 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 { DndProvider } from "https://esm.sh/react-dnd@16.0.1";
5import { HTML5Backend } from "https://esm.sh/react-dnd-html5-backend@16.0.1";
6import Chart from "https://esm.sh/chart.js/auto";
7import * as XLSX from "https://esm.sh/xlsx";
8
9// Explicit dynamic import of React hooks
10async function importReactHooks() {
11 try {
12 const ReactHooks = await import("https://esm.sh/react@18.2.0");
13 return {
14 useState: ReactHooks.useState,
15 useEffect: ReactHooks.useEffect,
16 useCallback: ReactHooks.useCallback
17 };
18 } catch (error) {
19 console.error("Failed to import React hooks:", error);
20 return {
21 useState: () => [null, () => {}],
98function App() {
99 // Defensive programming with fallback state management
100 const [hooks, setHooks] = React.useState(null);
101 const [charts, setCharts] = React.useState([]);
102 const [showDataModal, setShowDataModal] = React.useState(false);
103 const [currentChartData, setCurrentChartData] = React.useState(null);
104
105 // Load hooks dynamically on component mount
106 React.useEffect(() => {
107 importReactHooks().then((loadedHooks) => {
108 setHooks(loadedHooks);
109 }).catch(console.error);
111
112 // Defensive chart rendering with error handling
113 React.useEffect(() => {
114 if (!charts.length) return;
115

learningplatformmain.tsx4 matches

@omar1•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect, useRef } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5// Motivational quotes for inspiration
43 * JavaScript, Python, Java
44 * TypeScript, Rust
45 - Frameworks: React, Node.js, Django
46 - Cloud Technologies: AWS, Azure, Google Cloud
47 - DevOps: Docker, Kubernetes

moiPosterImprovedProfilePreview.tsx3 matches

@dcm31•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from "https://esm.sh/react@18.2.0";
3import { Val } from "../../shared/types.ts";
4
15 * Mimics the buildDotMoi profile page layout with tabs for Public, Unlisted, and Private vals
16 */
17const ProfilePreview: React.FC<ProfilePreviewProps> = ({
18 vals,
19 username,

stevensDemotypes.ts1 match

@mudassar864•Updated 1 week ago
1/**
2 * @jsxImportSource https://esm.sh/react@18.2.0
3 */
4

StarterPackFeeds9 file matches

@moe•Updated 41 mins ago
Hono + React + Tailwind + Farcaster Mini App Starter Project

reactHonoStarter4 file matches

@texoport•Updated 2 days 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