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/?q=react&page=449&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 4692 results for "react"(562ms)

servermain.tsx3 matches

@stevekrouse•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2import React, { useState, useEffect } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4import { Tldraw } from "https://esm.sh/@tldraw/tldraw@2.3.0";
5

serverREADME.md1 match

@stevekrouse•Updated 8 months ago
1tldraw example with builder, for consistent React versions.
2
3Migrated from folder: Archive/server

shySapphireLeopardmain.tsx4 matches

@stevekrouse•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4import React from "https://esm.sh/react";
5import { createRoot } from "https://esm.sh/react-dom/client";
6
7function App() {

requestCollectormain.tsx4 matches

@maxm•Updated 8 months ago
2 * This request collector val saves information about incoming requests
3 * and displays summary statistics on the home page. It uses SQLite for
4 * persistence and server-side React for rendering the UI. Users can click
5 * on a request ID to view full details of that request.
6 */
7
8/** @jsxImportSource https://esm.sh/react */
9import React from "https://esm.sh/react";
10import { renderToString } from "https://esm.sh/react-dom/server";
11
12interface RequestData {

postmanClonemain.tsx4 matches

@maxm•Updated 8 months ago
1/**
2 * This val creates a Postman-like interface for testing HTTP requests directly in the browser.
3 * It uses React for the UI and the Fetch API to make requests.
4 * The server function serves the HTML and handles the API requests.
5 */
6
7/** @jsxImportSource https://esm.sh/react */
8import React, { useState } from "https://esm.sh/react";
9import { createRoot } from "https://esm.sh/react-dom/client";
10
11function App() {

test_migratedmain.tsx2 matches

@jxnblk•Updated 8 months ago
1/** @jsxImportSource npm:preact */
2import { render } from "npm:preact-render-to-string";
3
4export function it(name, fn) {

memeGeneratormain.tsx4 matches

@stevekrouse•Updated 8 months ago
4 */
5
6/** @jsxImportSource https://esm.sh/react */
7import React, { useState, useRef, useEffect } from "https://esm.sh/react";
8import { createRoot } from "https://esm.sh/react-dom/client";
9
10interface MemeTemplate {
134 };
135
136 const handleSubmit = (e: React.FormEvent) => {
137 e.preventDefault();
138 generateMeme();

zod_demo_frontendmain.tsx5 matches

@stevekrouse•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2import React, { useState } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4import type { User } from "https://esm.town/v/stevekrouse/zod_demo_shared";
5
9 const [serverResponse, setServerResponse] = useState<string>("");
10
11 const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
12 const { name, value } = e.target;
13 setUser(prev => ({ ...prev, [name]: name === "age" ? parseInt(value) || 0 : value }));
14 };
15
16 const handleSubmit = async (e: React.FormEvent) => {
17 e.preventDefault();
18 setErrors({});

zod_demo_httpREADME.md1 match

@stevekrouse•Updated 8 months ago
2
3* @stevekrouse/zod_demo_http (this val)
4* @stevekrouse/zod_demo_frontend (client-side react component)
5* @stevekrouse/zod_demo_shared (code that is imported in both vals, but only run on the backend)
6

egoBoostermain.tsx3 matches

@stevekrouse•Updated 8 months ago
5 * and server-sent events for real-time streaming of compliments.
6 */
7/** @jsxImportSource https://esm.sh/react */
8import React, { useState, useEffect, useRef } from "https://esm.sh/react";
9import { createRoot } from "https://esm.sh/react-dom/client";
10import { marked } from "https://esm.sh/marked";
11

react-router-starter-remix-13 file matches

@jxnblk•Updated 2 days ago

reactHonoStarter4 file matches

@stfnsr•Updated 4 days ago