reactHonoExampleMessageInput.tsx4 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import type { Message } from "../shared/types.ts";
45export function MessageInput({ onSubmit }: { onSubmit: () => void }) {
6const [message, setMessage] = React.useState("");
78const handleSubmit = async (e: React.FormEvent) => {
9e.preventDefault();
10if (!message.trim()) return;
reactHonoExampleindex.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { type Message } from "../shared/utils.ts";
4import { App } from "./components/App.tsx";
reactHonoExampleindex.html1 match
4<meta charset="UTF-8">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>React Hono Val Town Starter</title>
7<link rel="stylesheet" href="/public/style.css">
8<link rel="icon" href="/public/favicon.svg" sizes="any" type="image/svg+xml">
reactHonoExampleApp.tsx3 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { type Message, MESSAGE_LIMIT } from "../../shared/utils.ts";
4import { MessageInput } from "./MessageInput.tsx";
7{ initialMessages = [], thisProjectURL }: { initialMessages?: Message[]; thisProjectURL?: string },
8) {
9const [messages, setMessages] = React.useState(initialMessages);
1011const fetchMessages = async () => {
ChatTESTING.md11 matches
5## Overview
67The application uses **Deno** as the test runner with **React Testing Library** for component testing. Tests are written in TypeScript and follow modern testing practices with proper mocking and isolation.
89## Quick Start
2829- **Test Runner**: Deno Test
30- **Component Testing**: React Testing Library
31- **Assertions**: Deno Standard Library Assert
32- **Mocking**: Custom utilities + built-in Deno mocks
5051```typescript
52/** @jsxImportSource https://esm.sh/react@18.2.0 */
53import { assertEquals, assertExists } from "https://deno.land/std@0.208.0/assert/mod.ts";
54import { render, cleanup } from "https://esm.sh/@testing-library/react@14.0.0?deps=react@18.2.0,react-dom@18.2.0";
55import React from "https://esm.sh/react@18.2.0";
56import { createMockMessage } from "../utils/test-helpers.ts";
57import ComponentToTest from "../../frontend/components/ComponentToTest.tsx";
363### Common Issues
3643651. **Import Errors**: Ensure React version pinning in imports
3662. **Component Not Rendering**: Check required props
3673. **Async Issues**: Use proper async/await patterns
431432```typescript
433/** @jsxImportSource https://esm.sh/react@18.2.0 */
434import { assertEquals, assertExists } from "https://deno.land/std@0.208.0/assert/mod.ts";
435import { render, cleanup } from "https://esm.sh/@testing-library/react@14.0.0?deps=react@18.2.0,react-dom@18.2.0";
436import React from "https://esm.sh/react@18.2.0";
437import { createMockMessage } from "../utils/test-helpers.ts";
438import NewComponent from "../../frontend/components/NewComponent.tsx";
454455- [Deno Testing Documentation](https://deno.land/manual/testing)
456- [React Testing Library Documentation](https://testing-library.com/docs/react-testing-library/intro/)
457- [Deno Standard Library Assert](https://deno.land/std/assert)
458- [ESM.sh for React Dependencies](https://esm.sh/)
459460## Contributing
71```typescript
72import { assertEquals, assertExists } from "https://deno.land/std@0.208.0/assert/mod.ts";
73import { render, cleanup } from "https://esm.sh/@testing-library/react@14.0.0?deps=react@18.2.0,react-dom@18.2.0";
7475Deno.test("Component Name - Test Category", async (t) => {
102The test environment includes:
103104- **React Testing Library**: For component testing
105- **Deno Standard Library**: For assertions
106- **Mock DOM**: Simulated browser environment
138### Common Issues
139140- **Import Errors**: Ensure all imports use the correct ESM URLs with React version pinning
141- **Component Not Rendering**: Check that all required props are provided
142- **Mock Issues**: Verify that mocks are properly set up in setup.ts
ChatMessage.test.tsx4 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { assertEquals, assertExists, assertStringIncludes } from "https://deno.land/std@0.208.0/assert/mod.ts";
3import { render } from "https://esm.sh/@testing-library/react@14.0.0?deps=react@18.2.0,react-dom@18.2.0";
4import { cleanup } from "https://esm.sh/@testing-library/react@14.0.0/cleanup?deps=react@18.2.0,react-dom@18.2.0";
5import React from "https://esm.sh/react@18.2.0";
6import MessageComponent from "../../frontend/components/Message.tsx";
7import type { Message } from "../../frontend/components/App.tsx";
Chatpackage.json5 matches
16"mcp",
17"chat",
18"react",
19"typescript"
20],
22"license": "MIT",
23"devDependencies": {
24"@types/react": "^18.2.0",
25"@types/react-dom": "^18.2.0"
26},
27"dependencies": {
28"react": "^18.2.0",
29"react-dom": "^18.2.0"
30}
31}
linkInBioTemplatemain.tsx2 matches
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
34export default async function(req: Request) {
linkInBioTemplatemain.tsx2 matches
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
34export default async function(req: Request) {