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=93&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 9427 results for "react"(1224ms)

daily-advice-appmain.tsx3 matches

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

mini-remixindex.tsx2 matches

@probablycorey•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useState } from "https://esm.sh/react@18.2.0";
3import { blob } from "https://esm.town/v/std/blob";
4import { defineAction, defineLoader, Form, render, useActionData, useLoaderData } from "./render.tsx";

mini-remixrender.tsx10 matches

@probablycorey•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"
4
5declare global {
20// Hook to access loader data on the client
21export const useLoaderData = <T extends Loader<any>>(): Awaited<ReturnType<T>> => {
22 const [loaderData, setLoaderData] = React.useState<Awaited<ReturnType<T>>>(() => {
23 const raw = document.getElementById("__LOADER_DATA__")?.textContent
24 return raw ? (JSON.parse(raw)) : {}
25 })
26
27 React.useEffect(() => {
28 window._setLoaderData = setLoaderData
29 }, [setLoaderData])
35export const useActionData = <T extends Action<any>>() => {
36 // Using null as initial state to make undefined explicit in the type
37 const [actionData, setActionData] = React.useState<ExtractActionResult<T>>()
38
39 React.useEffect(() => {
40 window._setActionData = setActionData
41 }, [])
45
46// Form component with built-in enhancement
47export const Form: React.FC<React.FormHTMLAttributes<HTMLFormElement>> = (props) => (
48 <form {...props} onSubmit={handleSubmit}>
49 {props.children}
52
53// Progressive-enhancement handler for <Form> submissions
54async function handleSubmit(e: React.FormEvent<HTMLFormElement>): Promise<void> {
55 try {
56 e.preventDefault()
79 loader: L,
80 action?: A,
81 Component?: React.FC,
82) => {
83 const isClientRequest = typeof document !== "undefined"

diceRollerUImain.tsx3 matches

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

moiPosterImprovedMoiEditor.tsx5 matches

@dcm31•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect, useRef, useCallback } from "https://esm.sh/react@18.2.0";
3import Editor from "./Editor.tsx";
4
32 * Component for editing moi.md files with a field-by-field editor for frontmatter
33 */
34const MoiEditor: React.FC<MoiEditorProps> = ({
35 value,
36 onChange,
221
222 // Toggle excludeFromPosts boolean
223 const handleExcludeFromPostsChange = (e: React.ChangeEvent<HTMLInputElement>) => {
224 setFrontmatter(prev => ({ ...prev, excludeFromPosts: e.target.checked }));
225 };
226
227 // Handle endpoint selection from dropdown
228 const handleEndpointSelect = (e: React.ChangeEvent<HTMLSelectElement>) => {
229 const selectedUrl = e.target.value;
230 if (selectedUrl) {

moiPosterImprovedApp.tsx5 matches

@dcm31•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useCallback, useEffect, useState, useRef } from "https://esm.sh/react@18.2.0";
3import { MoiFile, Val } from "../../shared/types.ts";
4import ProfilePreview from "./ProfilePreview.tsx";
18 * Main App component
19 */
20const App: React.FC = () => {
21 const [vals, setVals] = useState<Val[]>([]);
22 const [loading, setLoading] = useState(false);
240 pendingSaveContentRef.current = content;
241
242 // Also update the state for React
243 setMoiContent(content);
244 }, []);
347
348 // Handle API token change
349 const handleApiTokenChange = (e: React.ChangeEvent<HTMLInputElement>) => {
350 const newToken = e.target.value;
351 setApiToken(newToken);

moiPosterImprovedQuickEditor.tsx2 matches

@dcm31•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect, useRef, forwardRef, useImperativeHandle } from "https://esm.sh/react@18.2.0";
3import Editor from "./Editor.tsx";
4

moiPosterImprovedMoiEditorModal.tsx3 matches

@dcm31•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 { Val } from "../../shared/types.ts";
4import QuickEditor from "./QuickEditor.tsx";
26 * Modal component for editing moi.md files
27 */
28const MoiEditorModal: React.FC<MoiEditorModalProps> = ({
29 val,
30 moiContent,

speechmain.tsx6 matches

@salon•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4
5// --- Vertex Shader (Unchanged) ---
15// Shader: Murieron by murieron (https://www.shadertoy.com/view/WdXBW4)
16// Based on Clouds by IQ (https://www.shadertoy.com/view/4tdSWr)
17// Modified for audio reactivity
18precision mediump float;
19
161`;
162
163// --- React Component ---
164function App() {
165 const canvasRef = useRef<HTMLCanvasElement>(null);
861 <meta charset="UTF-8">
862 <meta name="viewport" content="width=device-width, initial-scale=1.0">
863 <title>Audio Reactive Clouds</title>
864 <style>${css}</style>
865 </head>

claudeCodeLoaderdemo.tsx2 matches

@matthamlin•Updated 1 week ago
1/** @jsxImportSource https://esm.sh/react@latest */
2
3"use client";
4
5import { useState } from "npm:react";
6import { ClaudeCodeLoader } from "./loader.tsx";
7import { Button } from "./ui/button.tsx";

new_website

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

IClickWolf4 file matches

@vtTestLocal•Updated 3 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