react-router-code-review by existential-birds/beagle
npx skills add https://github.com/existential-birds/beagle --skill react-router-code-review| 问题类型 | 参考文档 |
|---|---|
| 数据加载使用 useEffect、缺少 loaders、参数处理 | references/data-loading.md |
| Form 与 useFetcher 对比、action 模式 | references/mutations.md |
| 缺少错误边界、errorElement | references/error-handling.md |
| navigate() 与 Link 对比、待处理状态 | references/navigation.md |
loader 而非 useEffect 加载广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
defer() 进行并行数据获取<Form> 或 useFetcher 而非手动 fetcherrorElement 的错误边界isRouteErrorResponse() 检查错误类型<Link> 而非 navigate()useNavigation() 或 fetcher.state 显示待处理状态以下模式是 React Router 的正确用法 - 不应报告为问题:
useLoaderData<typeof loader>() 是类型注解,不是类型断言仅在特定上下文适用时才标记这些问题:
| 问题 | 仅在以下情况下标记 |
|---|---|
| 缺少 loader | 数据在服务端可用(非仅客户端) |
| 使用 useEffect 进行数据获取 | 数据不是仅客户端的(localStorage、浏览器 API、窗口尺寸) |
| 缺少 errorElement | 层级结构中没有父级路由具有错误边界 |
| 使用 navigate() 而非 Link | 导航不是由事件处理器或条件逻辑触发的 |
在报告任何问题之前,请加载并遵循 review-verification-protocol。
每周安装量
76
代码仓库
GitHub 星标数
41
首次出现
2026年1月20日
安全审计
安装于
gemini-cli58
claude-code58
opencode57
codex56
cursor52
github-copilot47
| Issue Type | Reference |
|---|---|
| useEffect for data, missing loaders, params | references/data-loading.md |
| Form vs useFetcher, action patterns | references/mutations.md |
| Missing error boundaries, errorElement | references/error-handling.md |
| navigate() vs Link, pending states | references/navigation.md |
loader not useEffectdefer() for parallel data fetching when appropriate<Form> or useFetcher not manual fetcherrorElement on routesisRouteErrorResponse() to check error types<Link> over navigate() where possibleuseNavigation() or fetcher.stateThese patterns are correct React Router usage - do not report as issues:
useLoaderData<typeof loader>() is a type annotation, not a type assertionOnly flag these issues when the specific context applies:
| Issue | Flag ONLY IF |
|---|---|
| Missing loader | Data is available server-side (not client-only) |
| useEffect for data fetching | Data is NOT client-only (localStorage, browser APIs, window size) |
| Missing errorElement | No parent route in the hierarchy has an error boundary |
| navigate() instead of Link | Navigation is NOT triggered by an event handler or conditional logic |
Load and follow review-verification-protocol before reporting any issue.
Weekly Installs
76
Repository
GitHub Stars
41
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli58
claude-code58
opencode57
codex56
cursor52
github-copilot47
TanStack Query v5 完全指南:React 数据管理、乐观更新、离线支持
2,500 周安装