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=448&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 4679 results for "react"(490ms)

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

dateme_form_reactmain.tsx1 match

@stevekrouse•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import date_me_doc_locations from "https://esm.town/v/stevekrouse/date_me_doc_locations";
3const Link = ({ href, children }) => {

dateme_browse_reactmain.tsx3 matches

@stevekrouse•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import isPointWithinRadius from "https://esm.sh/geolib/es/isPointWithinRadius";
3import { useLoaderData } from "https://esm.sh/react-router-dom@6.23.0?deps=react@18.2.0,react-dom@18.2.0";
4import date_me_doc_locations_geo from "https://esm.town/v/stevekrouse/date_me_doc_locations_geo";
5import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
32}
33
34// TODO - refactor this into a Cell React component
35function renderCell(header, row) {
36 let data = row[header];

lastloginREADME.md4 matches

@stevekrouse•Updated 8 months ago
30* If email, show that user's content, and a logout link to "/auth/logout"; if no email, show login options.
31* `import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton"`
32* Use the <LoginWithGoogleButton /> React Component, optionally supplying the `text` attribute
33* Add "via LastLogin" underneat LoginWithGoogleButton, centered, secondary text, linking to https://lastlogin.io/
34* Pass the email from the server to the client-side code if using React hydration or similar techniques.
35
36### How it works
37
381. Your users click on the <LoginWithGoogleButton /> React Component in your app
392. The <LoginWithGoogleButton /> opens a new window to /auth/login?provider=google in your app
403. This middleware directs them to log into Google via LastLogin
64* If email, show that user's content, and a logout link to "/auth/logout";
65* If no email, add a link to "Login or Sign Up" to "/auth/login"
66* Pass the email from the server to the client-side code if using React hydration or similar techniques.
67
68### How it works

react-router-starter-remix-13 file matches

@jxnblk•Updated 2 days ago

reactHonoStarter4 file matches

@stfnsr•Updated 3 days ago