Files
Claude CodeandClaude aece00ae56 docs: 完成基础入门模块 - 添加剩余5篇核心文档
## 完成内容

### 新增文档 (5篇)
1. **state-lifecycle.mdx** (18,648字节)
   - State与生命周期完整指南
   - useState使用详解
   - useEffect副作用处理
   - 组件生命周期详解
   - 状态提升最佳实践

2. **events.mdx** (20,607字节)
   - 事件处理完整教程
   - 合成事件系统
   - 事件对象详解
   - 事件委托优化
   - 表单事件处理

3. **conditional-rendering.mdx** (15,932字节)
   - 条件渲染5种方法
   - if语句、三元运算符、逻辑与运算符
   - 早期返回模式
   - 条件渲染与列表渲染结合
   - 性能优化技巧

4. **lists-and-keys.mdx** (新建)
   - 列表渲染核心概念
   - Array.map()使用方法
   - Keys的重要性和选择规则
   - 动态列表操作
   - 过滤、排序和性能优化
   - 虚拟化长列表

5. **forms.mdx** (新建)
   - 受控组件与非受控组件
   - 表单验证策略
   - 复杂表单处理
   - 动态字段和嵌套对象
   - 第三方表单库介绍
   - 性能优化和最佳实践

### 配置更新
- **sidebars.js** - 更新侧边栏配置
  - 主侧边栏: 添加所有8篇文档到"🚀 基础入门"分类
  - 兼容侧边栏: 同步更新
  - 保持分类默认展开状态

### 文档统计
- 基础入门模块现已完成 8/8 篇
- 累计文档内容超过 100,000 字节
- 包含 50+ 代码示例
- 覆盖 React 核心概念完整体系

### 测试验证
 所有8个页面HTTP 200状态正常
 侧边栏导航显示正确
 服务器运行在 http://localhost:3011/

### 文档特色
- 使用统一的自定义MDX组件系统
- 包含丰富的交互式代码示例
- 实践练习和常见错误详解
- 性能优化和最佳实践指导
- 符合 React 官方推荐规范

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 14:32:10 +08:00

3.1 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Quick Start

Common Commands:

  • npm run start - Start development server at http://localhost:3000
  • npm run build - Generate production static site to build/ directory
  • npm run serve - Preview production build locally
  • npm run deploy - Deploy to GitHub Pages
  • npm run clear - Clear Docusaurus build cache and generated files

Requirements:

  • Node.js >= 20.0
  • Yarn or npm

Project Overview

This is a Docusaurus 3.9.2 static documentation website built with React. It's a classic Docusaurus template with documentation, blog functionality, and custom components. The site generates static pages that can be deployed to any static hosting service.

Directory Structure

  • /docs - Markdown/MDX documentation files organized by category
  • /blog - Blog posts with MD/MDX support and frontmatter
  • /src/pages - Custom React pages (e.g., homepage)
  • /src/components - Reusable React components
  • /src/css/custom.css - Global CSS with Infima theme overrides
  • /static - Static assets (images, icons, favicon, etc.)

Key Configuration Files

  • docusaurus.config.js - Main site configuration (title, URL, navbar, footer, themes, plugins)

    • Configured for GitHub integration (edit links, deployment)
    • Light theme: GitHub, Dark theme: Dracula
    • i18n set to English (default)
    • Color mode: system preference (respects prefers-color-scheme)
  • sidebars.js - Documentation sidebar configuration (auto-generated from docs structure)

  • package.json - Dependencies and npm/yarn scripts

Content Management

Documentation:

  • Files in /docs with frontmatter are automatically added to the sidebar
  • _category_.json files in subdirectories control sidebar grouping and ordering
  • MDX files support React components within Markdown

Blog:

  • Posts support both MD and MDX formats
  • Frontmatter required: title, author, tags, date
  • authors.yml and tags.yml in /blog manage blog metadata

Architecture Notes

  • Built with React 19 and Docusaurus 3.9.2
  • Uses Infima CSS framework for styling
  • Static Site Generation (SSG) for fast, SEO-friendly pages
  • MDX integration enables interactive documentation with React components
  • No test framework currently configured (no Jest, Vitest, or test files)

Development Workflow

  1. Local Development: Run yarn start for live-reload development server
  2. Content Creation: Add MD/MDX files to /docs or /blog directories
  3. Custom Components: Create React components in /src/components
  4. Build: Run yarn build to generate static files
  5. Deploy: Use yarn deploy (configured for GitHub Pages) or deploy build/ to static host

Key Features

  • Responsive design with mobile support
  • Dark/light mode toggle
  • Syntax highlighting via Prism
  • Search-ready (plugin configured)
  • RSS/Atom feeds for blog
  • Internationalization support (i18n)
  • GitHub integration (edit this page, deployment)

设计规范

@DETAILED_DESIGN.md @PROJECT_PLAN.md

开发规范

@FRONTEND_CHECK_RULES.md