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%22Optional%20title%22?q=react&page=168&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 11962 results for "react"(1239ms)

ALogin.tsx3 matches

@aditya_2629โ€ขUpdated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useContext } from "https://esm.sh/react@18.2.0";
3import { AuthContext } from "./App.tsx";
4
10 const [loading, setLoading] = useState(false);
11
12 const handleSubmit = async (e: React.FormEvent) => {
13 e.preventDefault();
14

AApp.tsx3 matches

@aditya_2629โ€ขUpdated 1 week ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
3import { User, Task, Notification } from "../../shared/types.ts";
4import Login from "./Login.tsx";
12
13// Auth context
14export const AuthContext = React.createContext<{
15 user: User | null;
16 token: string | null;

Aindex.tsx3 matches

@aditya_2629โ€ข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 App from "./components/App.tsx";
5

Aindex.html1 match

@aditya_2629โ€ขUpdated 1 week ago
53 <div id="root"></div>
54
55 <!-- React and dependencies -->
56 <script type="module" src="/frontend/index.tsx"></script>
57

AREADME.md2 matches

@aditya_2629โ€ขUpdated 1 week ago
18โ”‚ โ””โ”€โ”€ index.ts # Main entry point for the backend
19โ”œโ”€โ”€ frontend/
20โ”‚ โ”œโ”€โ”€ components/ # React components
21โ”‚ โ”œโ”€โ”€ index.html # Main HTML template
22โ”‚ โ””โ”€โ”€ index.tsx # Frontend entry point
28
29- **Backend**: Hono.js, SQLite
30- **Frontend**: React, Tailwind CSS
31- **Authentication**: JWT
32- **Real-time Updates**: Server-Sent Events
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from 'https://esm.sh/react@18.2.0';
3
4interface LoginFormProps {
7}
8
9const LoginForm: React.FC<LoginFormProps> = ({ onLogin, onCancel }) => {
10 const [username, setUsername] = useState('');
11 const [isLoading, setIsLoading] = useState(false);
12 const [error, setError] = useState<string | null>(null);
13
14 const handleSubmit = async (e: React.FormEvent) => {
15 e.preventDefault();
16
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from 'https://esm.sh/react@18.2.0';
3import { ChatRoom } from '../../shared/types.ts';
4
9}
10
11const ChatRoomList: React.FC<ChatRoomListProps> = ({ rooms, onSelectRoom, isLoading }) => {
12 // Get category emoji
13 const getCategoryEmoji = (category: string): string => {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect, useRef } from 'https://esm.sh/react@18.2.0';
3import { ChatRoom as ChatRoomType, Message, User } from '../../shared/types.ts';
4
9}
10
11const ChatRoom: React.FC<ChatRoomProps> = ({ room, user, onClose }) => {
12 const [messages, setMessages] = useState<Message[]>([]);
13 const [newMessage, setNewMessage] = useState('');
47 };
48
49 const handleSendMessage = async (e: React.FormEvent) => {
50 e.preventDefault();
51
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from 'https://esm.sh/react@18.2.0';
3import { OpportunityInput, CATEGORIES } from '../../shared/types.ts';
4
8}
9
10const OpportunityForm: React.FC<OpportunityFormProps> = ({ onSubmit, onCancel }) => {
11 const [formData, setFormData] = useState<OpportunityInput>({
12 title: '',
20 const [error, setError] = useState<string | null>(null);
21
22 const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
23 const { name, value } = e.target;
24 setFormData(prev => ({ ...prev, [name]: value }));
25 };
26
27 const handleSubmit = async (e: React.FormEvent) => {
28 e.preventDefault();
29 setError(null);
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from 'https://esm.sh/react@18.2.0';
3import { Opportunity, formatDate } from '../../shared/types.ts';
4
7}
8
9const OpportunityCard: React.FC<OpportunityCardProps> = ({ opportunity }) => {
10 const categoryEmoji = getCategoryEmoji(opportunity.category);
11

reactHonoStarter4 file matches

@ultragamer969โ€ขUpdated 3 hours ago

reactHonoStarter4 file matches

@lightweightโ€ขUpdated 9 hours 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