- PlatformRock.tsx 335 行:保留全部 state、loadData/loadTokens、useEffect、 handler 与顶层布局;默认导出名不变,App.tsx 的 lazy 导入未改 - platformRock/ 子目录:tokenColumns 329、RockStrategyCard 267、 PurchaseTokenModal 183、RockTokenTable 156、RockMetricCards 124、 VoucherPreviewModal 95、RockTokenFilterBar 76、UidEditModal 47、types.ts 6 state 归属与更新时机、请求次数与参数、useEffect 依赖语义均未改变;子组件 props 显式声明类型,无 any;行级异步 handler 随表格下沉,state setter 经显式类型 props 传入。 验证: - SSR 快照 renderToString 拆分前后字节一致(40920 bytes) - jsdom 交互差分:拆分前后 23 个检查点的 DOM 快照与 API 调用日志完全一致 (覆盖采购、UID 修正、解冻、释放、熔断、筛选/搜索/翻页、保存配置、连通性测试) - 原文件应保留的 230 行代码逐字命中
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the Oxlint configuration
If you are developing a production application, we recommend enabling type-aware lint rules by installing oxlint-tsgolint and editing .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
See the Oxlint rules documentation for the full list of rules and categories.