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/image-url.jpg%20%22Image%20title%22?q=react&page=867&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 9343 results for "react"(2104ms)

theHereTimesmain.tsx34 matches

@gio•Updated 8 months ago
16
17import { Loader } from "https://esm.sh/@googlemaps/js-api-loader@1.16.2";
18import ReactDOM from "https://esm.sh/react-dom@18.2.0";
19import React from "https://esm.sh/react@18.2.0";
20
21function App() {
22 const mapRef = React.useRef(null);
23 const [map, setMap] = React.useState(null);
24 const [center, setCenter] = React.useState({ lat: 40.7128, lng: -74.006 });
25 const [zoom, setZoom] = React.useState(10);
26 const [news, setNews] = React.useState([]);
27 const [locations, setLocations] = React.useState([]);
28 const [isDrawerOpen, setIsDrawerOpen] = React.useState(false);
29 const [error, setError] = React.useState(null);
30 const markersRef = React.useRef([]);
31 const [googleMaps, setGoogleMaps] = React.useState(null);
32 const [selectedLocation, setSelectedLocation] = React.useState(null);
33 const [searchQuery, setSearchQuery] = React.useState("");
34 const searchBoxRef = React.useRef(null);
35
36 React.useEffect(() => {
37 const initMap = async () => {
38 try {
106 }, []);
107
108 React.useEffect(() => {
109 if (map && locations.length > 0 && googleMaps) {
110 console.log("Updating markers. Number of locations:", locations.length);
204 };
205
206 const filteredNews = React.useMemo(() => {
207 if (!selectedLocation) return [];
208 return news.filter(article => article.title.toLowerCase().includes(selectedLocation.name.toLowerCase()));
209 }, [news, selectedLocation]);
210
211 return React.createElement(
212 "div",
213 { style: { display: "flex", flexDirection: "column", height: "100vh" } },
214 React.createElement(
215 "div",
216 { id: "search-container", className: "search-container" },
217 React.createElement("input", {
218 id: "search-input",
219 type: "text",
223 }),
224 ),
225 React.createElement("div", { ref: mapRef, style: { flexGrow: 1 } }),
226 isDrawerOpen && React.createElement(
227 "div",
228 { className: "drawer" },
229 React.createElement("button", { onClick: () => setIsDrawerOpen(false), className: "close-button" }, "×"),
230 React.createElement("h2", null, selectedLocation ? `News for ${selectedLocation.name}` : "Local News"),
231 error
232 ? React.createElement("p", { className: "error" }, error)
233 : filteredNews.length > 0
234 ? filteredNews.map((article, index) =>
235 React.createElement(
236 "div",
237 { key: index, className: "article" },
238 React.createElement("h3", null, article.title),
239 React.createElement("p", null, article.description),
240 React.createElement("a", { href: article.url, target: "_blank", rel: "noopener noreferrer" }, "Read more"),
241 )
242 )
243 : React.createElement("p", null, "No news articles found for this location."),
244 ),
245 React.createElement(
246 "div",
247 { className: "attribution" },
248 React.createElement(
249 "a",
250 {
260
261function client() {
262 ReactDOM.createRoot(document.getElementById("root")).render(React.createElement(App));
263}
264

infoboxCrawlermain.tsx3 matches

@stevekrouse•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
3import dagre from "https://esm.sh/cytoscape-dagre@2.5.0";
4import cytoscape from "https://esm.sh/cytoscape@3.23.0";
5import React, { useEffect, useRef, useState } from "https://esm.sh/react";
6import { createRoot } from "https://esm.sh/react-dom/client";
7
8cytoscape.use(dagre);

infoboxCrawlermain.tsx3 matches

@jdan•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
3import dagre from "https://esm.sh/cytoscape-dagre@2.5.0";
4import cytoscape from "https://esm.sh/cytoscape@3.23.0";
5import React, { useEffect, useRef, useState } from "https://esm.sh/react";
6import { createRoot } from "https://esm.sh/react-dom/client";
7
8cytoscape.use(dagre);

todoListUsingBlobmain.tsx3 matches

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

valcontributionchartmain.tsx4 matches

@iamseeley•Updated 8 months ago
1// This approach will fetch data from the specified endpoint, process it to create a GitHub-style contribution chart,
2// and render it using React. We'll use the fetch API to get the data, process it to create a heatmap-like structure,
3// and then use CSS Grid to render the chart with varying shades of green based on the number of vals created each day.
4
5/** @jsxImportSource https://esm.sh/react */
6import React, { useState, useEffect } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
8
9function App() {

linkInBioTemplatemain.tsx2 matches

@saludes•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {

bulletinBoardmain.tsx3 matches

@roramigator•Updated 8 months ago
3// The app uses SQLite for data storage and includes both server-side and client-side components.
4
5/** @jsxImportSource https://esm.sh/react */
6import React, { useEffect, useState } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
8
9function App() {

religionClickerGamemain.tsx3 matches

@roramigator•Updated 8 months ago
1// This val creates a sarcastic idle clicker game about starting a religion.
2
3/** @jsxImportSource https://esm.sh/react */
4import React, { useEffect, useState } from "https://esm.sh/react";
5import { createRoot } from "https://esm.sh/react-dom/client";
6
7function App() {

valcontributionchartmain.tsx4 matches

@ejfox•Updated 8 months ago
1// This approach will fetch data from the specified endpoint, process it to create a GitHub-style contribution chart,
2// and render it using React. We'll use the fetch API to get the data, process it to create a heatmap-like structure,
3// and then use CSS Grid to render the chart with varying shades of green based on the number of vals created each day.
4
5/** @jsxImportSource https://esm.sh/react */
6import React, { useState, useEffect } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
8
9function App() {

knowledgeExplorermain.tsx3 matches

@sharanbabu•Updated 8 months ago
4 * and enables exploration of related topics or deeper dives using arrow keys or buttons.
5 */
6/** @jsxImportSource https://esm.sh/react@18.2.0 */
7import React, { useState, useEffect, useCallback } from "https://esm.sh/react@18.2.0";
8import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
9
10const SUGGESTIONS = ["Quantum Computing", "Renaissance Art", "Climate Change", "Artificial Intelligence", "Space Exploration"];

IClickWolf4 file matches

@vtTestLocal•Updated 2 days ago
Starter template with client-side React & Hono server

vt-discord4 file matches

@boucher•Updated 6 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