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=123&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 9583 results for "react"(1127ms)

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

stevensDemoREADME.md1 match

@mudassar864•Updated 1 week ago
1# React Hono Val Town Project Starter Template
2
3This is a starter template for a full-stack app in a Val Town Project. The app itself is a simple persistent message board.

stevensDemoREADME.md5 matches

@mudassar864•Updated 1 week ago
1# Frontend
2
3This template is a classic client-side-only React app.
4
5## `index.html`
9This HTML file imports `/frontend/style.css` from `/public/style.css` and `/frontend/favicon.svg` from `/frontend/favicon.svg`. Everything in `/frontend/` is mapped to `/public` by `/backend/index.ts`. This is just a convention. You could import & serve everything out of the same folder name.
10
11This HTML file has a `<div id="root"></div>`, which is where we mount the React app.
12
13This HTML file imports `/frontend/index.tsx` from `/public/index.tsx`, which is the **entrypoint** for all frontend JavaScript, including all the React. It is not a problem that it imports a file with a `.tsx` extension becaues browsers ignore file extensions. They only pay attention to content-types, which is great, because all these files will be returned as transpiled JS with the appropriate JS content type by [stevekrouse/utils/serve-public](https://www.val.town/x/stevekrouse/utils/branch/main/code/serve-public/README.md).)
14
15## `index.tsx`
16
17This file is the **entrypoint** for frontend JavaScript. It imports the React app from `/frontend/components/App.tsx` and mounts it on `<div id="root"></div>`.
18
19It also looks for *bootstrapped* JSON data at `window.__INITIAL_DATA`, and passes that only to the `<App />`.
25## `components/`
26
27This directory is where the React components are stored. They're pretty standard client-side React components.

stevensDemoREADME.md2 matches

@mudassar864•Updated 1 week ago
12## Serving assets to the frontend
13
14This backend HTTP server is responsible for serving all static assets to the browser to render the app, including HTML, JavaScript (including all client-side React), CSS, and even the favicon SVG.
15
16In a normal server environment, you would likely use a middleware [like this one](https://hono.dev/docs/getting-started/nodejs#serve-static-files) to serve static files. Some frameworks or deployment platforms automatically make any content inside a `public/` folder public.
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors

stevensDemoREADME.md1 match

@mudassar864•Updated 1 week ago
8## Migrations
9
10In `backend/database/migrations.ts`, this app creates a new SQLite table `reactHonoStarter_messages` to store messages.
11
12This "migration" runs once on every app startup because it's imported in `index.ts`. You can comment this line out for a slight (30ms) performance improvement on cold starts. It's left in so that users who fork this project will have the migration run correctly.

stevensDemopopulateDemo.ts1 match

@mudassar864•Updated 1 week ago
274 createMemory(
275 "2025-04-13",
276 "Lucas allergic to peanuts - mild reaction only, not anaphylactic.",
277 "telegram",
278 "telegram",

stevensDemoNotebookView.tsx5 matches

@mudassar864•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";
9
89 }, [fetchMemories]);
90
91 const handleAddMemory = async (e: React.FormEvent) => {
92 e.preventDefault();
93 if (!newMemoryText.trim()) return;
144 };
145
146 const handleUpdateMemory = async (e: React.FormEvent) => {
147 e.preventDefault();
148 if (!editingMemory || !editingMemory.text.trim()) return;

StarterPackFeeds10 file matches

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