frontend-standards

majiayu000 的头像作者 majiayu000

React patterns and frontend best practices for this project. Use when implementing React components, hooks, routes, styling, or client-side logic in packages/client.

📖 中文导读:React patterns and frontend best practices for this project. Use when implementing React components, hooks, routes, styling, or client-side logic in packages/client. 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: frontend-standards description: React patterns and frontend best practices for this project. Use when implementing React components, hooks, routes, styling, or client-side logic in packages/client.

Frontend Standards

Key Principles

  • Avoid useEffect - Use TanStack Query, useSyncExternalStore, or event handlers instead
  • Prefer Suspense - For loading states and async boundaries
  • useSyncExternalStore - For external state subscriptions (WebSocket, global stores)
  • Server is the source of truth - Don't maintain conflicting client state

Tech Stack

  • React 18, TanStack Router, TanStack Query, Tailwind CSS, xterm.js, Valibot

Detailed Documentation