building-react-native-application

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

React Native application

React Native 应用

Overview

概述

Opinionated ecosystem for building Expo/React Native apps with a consistent architecture, library stack, and UI system (
src/ui
).
一套用于构建 Expo/React Native 应用的规范化生态,采用一致的架构、依赖栈和 UI 系统(
src/ui
)。

Tech stack

技术栈

LayerChoice
RuntimeExpo
LanguageTypeScript
StylingNativeWind, Tailwind CSS, class-variance-authority
RoutingReact Navigation (static config,
src/routes
)
Server stateTanStack Query
Client global stateZustand
HTTPAxios
Datesdate-fns (
src/libs/date-utils/
)
Presentational UIReact Native Reusables-style primitives in
src/ui/
层级选择
运行时Expo
语言TypeScript
样式NativeWind、Tailwind CSS、class-variance-authority
路由React Navigation(静态配置,
src/routes
)
服务端状态TanStack Query
客户端全局状态Zustand
HTTPAxios
日期处理date-fns(
src/libs/date-utils/
)
展示型 UI
src/ui/
中采用 React Native Reusables 风格的 primitives

Setup

设置

ItemRequiredWhenHow
Standing rulerequiredScaffold new appAdd
- `<target_path>` follows building-react-native-application; load it before changing code there.
to root
AGENTS.md
(create when missing) and to root
CLAUDE.md
when it exists without importing
AGENTS.md
; skip a file that has it
项目是否必需使用场景操作方式
固定规则必需搭建新应用将
- `<target_path>` follows building-react-native-application; load it before changing code there.
添加到根目录
AGENTS.md
(不存在时创建);如果根目录存在
CLAUDE.md
但未导入
AGENTS.md
,也添加到该文件;如果文件中已有则跳过

Agent workflow

Agent 工作流

Follow this skill for Expo/React Native work. Resolve every required Setup row, then match Entry points and every applicable Task types row; open every linked local reference before coding. For component work, open creating-component and follow its decision tree. Platform docs live in each reference’s References section.
对于 Expo/React Native 工作,请遵循本 skill。完成 Setup 中每一个 必需 项,然后匹配 Entry points 以及 Task types 中所有适用的行;编写代码前,打开每一个关联的本地参考文档。对于组件工作,打开 creating-component 并遵循其中的决策树。平台文档位于每个参考文档的 References 部分。

Entry points

入口

Use the first matching row; combine when the task spans types.
EntryWhenGo to
ComponentBuilding, moving, or recategorizing any componentcreating-component
StructureFolder roles, dependency flow, or where a module belongsmanaging-project-structure
Task bundleAPI, forms, styling, bootstrap, navigation, keyboard, fonts, splashTask types table
LookupKnown doc name or single referenceReference index
使用第一个匹配项;如果任务跨越多种类型,则组合使用。
入口使用场景前往
Component构建、移动或重新归类任何组件creating-component
Structure文件夹职责、依赖流,或模块应放在何处managing-project-structure
任务组合API、表单、样式、项目初始化、导航、键盘、字体、启动画面Task types 表
查询已知文档名称或单个参考文档Reference index

Task types

任务类型

Match every row that applies. Open every local link in Docs before coding.
Task typeDocs
New screen / featuremanaging-project-structure, creating-feature, creating-route-component, creating-screen-component, creating-component
UI primitive (
src/ui/
)
creating-component, creating-ui-component, discovering-registry-components, managing-wrapper-components, add-registry-component.cjs
Feature componentcreating-component, creating-feature-component, managing-wrapper-components
Bottom sheetcreating-component, creating-bottom-sheet-component, managing-wrapper-components
Async / list UIcreating-component, creating-async-component, creating-api, managing-state
Form (single step)creating-form-component, managing-form-error, managing-state, managing-date
Multi-step formmanaging-stepper-hook, managing-stepper-form, creating-form-component, managing-form-error
API + data hookscreating-api, setting-up-axios, managing-api-error, managing-state, managing-date
Date / timemanaging-date
Refactor / move componentcreating-component
Styling / themesetting-up-nativewind, managing-styling, setting-up-theming, setting-up-tailwind-theme, setting-up-navigation-theme, overriding-classname
Navigation components & backgroundscreating-navigation-component, setting-up-navigation-theme, managing-screen-background
Navigation hookscreating-route-component, creating-navigation-component
KeyboardKeyboard controller — Components
Fontssetting-up-theming, setting-up-tailwind-theme, Expo — Fonts
Splash screenExpo — SplashScreen
Scaffold new appscaffolding-application
Project bootstrapmanaging-project-structure, managing-environment, managing-linting, managing-package-installs, setting-up-nativewind, setting-up-registry-components
Routing onlycreating-route-component, creating-navigation-component
匹配所有适用的行。编写代码前,打开 Docs 中的每一个本地链接。
任务类型文档
新屏幕 / 功能managing-project-structure、creating-feature、creating-route-component、creating-screen-component、creating-component
UI primitive(
src/ui/
)
creating-component、creating-ui-component、discovering-registry-components、managing-wrapper-components、add-registry-component.cjs
功能组件creating-component、creating-feature-component、managing-wrapper-components
Bottom sheetcreating-component、creating-bottom-sheet-component、managing-wrapper-components
异步 / 列表 UIcreating-component、creating-async-component、creating-api、managing-state
单步表单creating-form-component、managing-form-error、managing-state、managing-date
多步表单managing-stepper-hook、managing-stepper-form、creating-form-component、managing-form-error
API + 数据 hookscreating-api、setting-up-axios、managing-api-error、managing-state、managing-date
日期 / 时间managing-date
重构 / 移动组件creating-component
样式 / 主题setting-up-nativewind、managing-styling、setting-up-theming、setting-up-tailwind-theme、setting-up-navigation-theme、overriding-classname
导航组件与背景creating-navigation-component、setting-up-navigation-theme、managing-screen-background
导航 hookscreating-route-component、creating-navigation-component
键盘Keyboard controller — Components
字体setting-up-theming、setting-up-tailwind-theme、Expo — Fonts
启动画面Expo — SplashScreen
搭建新应用scaffolding-application
项目初始化managing-project-structure、managing-environment、managing-linting、managing-package-installs、setting-up-nativewind、setting-up-registry-components
仅路由creating-route-component、creating-navigation-component

Reference index

参考资料索引

ReferenceEntryLayerPurpose
creating-apiAPIHTTP modules under
src/api/
creating-async-componentComponentLoading, error, and list UI wrappers
creating-bottom-sheet-componentComponentBottom sheet UI in
src/ui/BottomSheet/
creating-componentComponentComponentDecision tree for any component work
creating-featureFeatureFeature module folders and barrels
creating-feature-componentComponentDomain UI blocks in features
creating-form-componentFormForm fields and form shells
creating-navigation-componentRouteReusable headers, tab bars, drawer content
creating-route-componentRoute
[Name][NavigatorType]
modules in
src/routes/
creating-screen-componentFeatureRoute-facing
*Screen
in features
creating-ui-componentComponentShared primitives in
src/ui/
discovering-registry-componentsComponentRegistry lookup by intent and labels
managing-api-errorAPIAPI error handling patterns
managing-dateDatedate-fns and
src/libs/date-utils/
managing-environmentSetupFeature
env.ts
and env vars
managing-form-errorFormForm validation and error display
managing-lintingSetupESLint and Prettier setup
managing-package-installsSetupPackage manager detection and install scripts
managing-project-structureStructureArchitectureFolder layout and dependency flow
managing-screen-backgroundRouteScreen background vs navigation theme
managing-stateStateTanStack Query hooks and Zustand stores
managing-stepper-formFormMulti-step form UI
managing-stepper-hookFormMulti-step form state hook
managing-stylingStylingStyling conventions and tokens
managing-wrapper-componentsComponentWrapper and composition patterns
overriding-classnameStyling
className
override rules
scaffolding-applicationSetupExpo
blank-typescript
scaffold
setting-up-axiosAPIAxios client setup
setting-up-nativewindStylingNativeWind install; pnpm isolated JSX runtime
setting-up-navigation-themeStylingReact Navigation theme objects
setting-up-registry-componentsSetupRegistry /
src/ui/
bootstrap
setting-up-themingStylingDesign tokens and theme CSS
setting-up-tailwind-themeStylingTailwind / NativeWind theme config
参考资料入口层级用途
creating-apiAPI
src/api/
下的 HTTP 模块
creating-async-componentComponent加载、错误和列表 UI 包装器
creating-bottom-sheet-componentComponent
src/ui/BottomSheet/
中的 Bottom sheet UI
creating-componentComponentComponent任何组件工作的决策树
creating-featureFeature功能模块文件夹和 barrel 导出
creating-feature-componentComponent功能中的领域 UI 区块
creating-form-componentForm表单字段和表单容器
creating-navigation-componentRoute可复用的 headers、tab bars、drawer content
creating-route-componentRoute
src/routes/
中的
[Name][NavigatorType]
模块
creating-screen-componentFeature功能中面向路由的
*Screen
creating-ui-componentComponent
src/ui/
中共享的 primitives
discovering-registry-componentsComponent按意图和标签查找 registry 组件
managing-api-errorAPIAPI 错误处理模式
managing-dateDatedate-fns 和
src/libs/date-utils/
managing-environmentSetup功能
env.ts
和环境变量
managing-form-errorForm表单验证和错误显示
managing-lintingSetupESLint 和 Prettier 设置
managing-package-installsSetup包管理器检测和安装脚本
managing-project-structureStructure文件夹布局和依赖流
managing-screen-backgroundRoute屏幕背景与导航主题
managing-stateStateTanStack Query hooks 和 Zustand stores
managing-stepper-formForm多步表单 UI
managing-stepper-hookForm多步表单状态 hook
managing-stylingStyling样式约定和设计 token
managing-wrapper-componentsComponent包装器和组合模式
overriding-classnameStyling
className
覆盖规则
scaffolding-applicationSetupExpo
blank-typescript
脚手架
setting-up-axiosAPIAxios 客户端设置
setting-up-nativewindStylingNativeWind 安装;pnpm 隔离的 JSX runtime
setting-up-navigation-themeStylingReact Navigation theme 对象
setting-up-registry-componentsSetupRegistry /
src/ui/
初始化
setting-up-themingStyling设计 token 和主题 CSS
setting-up-tailwind-themeStylingTailwind / NativeWind 主题配置