Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

react-router-code-review

/react-router-code-review

Przegląda kod React Router v6.4+ pod kątem ładowania danych, mutacji, obsługi błędów i wzorców nawigacji, w tym loaderów i akcji.

Repozytorium
beagle ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
09.08.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 09.08.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Przegląda kod React Router v6.4+ pod kątem ładowania danych, mutacji, obsługi błędów i wzorców nawigacji, w tym loaderów i akcji.

Oryginalny opis (EN)

Reviews React Router code for proper data loading, mutations, error handling, and navigation patterns. Use when reviewing React Router v6.4+ code, loaders, actions, or navigation logic.

Jak działa

  1. Quick Reference
  2. Review Checklist
  3. Valid Patterns (Do NOT Flag)
  4. Context-Sensitive Rules
  5. Gates (before reporting any finding)
  6. When to Load References
  7. Review Questions
Sekcje z nagłówków SKILL.md, w oryginale · 83 linii, 603 słów
Podgląd SKILL.md
---
name: react-router-code-review
description: Reviews React Router code for proper data loading, mutations, error handling, and navigation patterns. Use when reviewing React Router v6.4+ code, loaders, actions, or navigation logic.
---

# React Router Code Review

## Quick Reference

| Issue Type | Reference |
|------------|-----------|
| useEffect for data, missing loaders, params | [references/data-loading.md](references/data-loading.md) |
| Form vs useFetcher, action patterns | [references/mutations.md](references/mutations.md) |
| Missing error boundaries, errorElement | [references/error-handling.md](references/error-handling.md) |
| navigate() vs Link, pending states | [references/navigation.md](references/navigation.md) |

## Review Checklist

- [ ] Data loaded via `loader` not `useEffect`
- [ ] Route params accessed type-safely with validation
- [ ] Using `defer()` for parallel data fetching when appropriate
- [ ] Mutations use `<Form>` or `useFetcher` not manual fetch
- [ ] Actions handle both success and error cases
- [ ] Error boundaries with `errorElement` on routes
- [ ] Using `isRouteErrorResponse()` to check error types
- [ ] Navigation uses `<Link>` over `navigate()` where possible
- [ ] Pending states shown via `useNavigation()` or `fetcher.state`
- [ ] No navigation in render (only in effects or handlers)

## Valid Patterns (Do NOT Flag)

These patterns are correct React Router usage - do not report as issues:

- **useEffect for client-only data** - Loaders run server-side; localStorage, window dimensions, and browser APIs must use useEffect
- **navigate() in event handlers** - Link is for declarative navigation; navigate() is correct for imperative navigation in callbacks/handlers
- **Type annotation on loader data** - `useLoaderData<typeof loader>()` is a type annotation, not a type assertion
- **Empty errorElement at route level** - Route may intentionally rely on parent error boundary
- **Form without action prop** - Posts to current URL by convention; explicit action is optional
- **loader returning null** - Valid when data may not exist; null is a legitimate loader return value
- **Using fetcher.data without checking fetcher.state** - May be intentional when stale data is acceptable during revalidation

## Context-Sensitive Rules

Only 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 |

## Gates (before reporting any finding)

Run in order. **Pass each gate with evidence** (paths, line refs, or a one-line quote from code)—not intuition alone.

### Gate 1 — Scope the route surface

**Pass when:** You have repo path(s) to the route module, `routes` config entry, or layout that owns the behavior under review (write them in your notes before flagging).

### Gate 2 — Context-sensitive match

**Pass when:** For every issue that maps to **Context-Sensitive Rules**, the **Flag ONLY IF** condition is satisfied with a one-line rationale tied to the code; for other checklist items, you have a concrete code citation (path + line or short excerpt).

### Gate 3 — Non-issue patterns

**Pass when:** The behavior is not covered by **Valid Patterns (Do NOT Flag)** for that category.

### Gate 4 — Verification protocol

Load and follow [review-verification-protocol](../review-verification-protocol/SKILL.md). **Pass when:** Its pre-report checklist (and any issue-type subsection that applies) is complete for each finding you will output.

## When to Load References

- Reviewing data fetching code → data-loading.md
- Reviewing forms or mutations → mutations.md
- Reviewing error handling → error-handling.md
- Reviewing navigation logic → navigation.md

## Review Questions

1. Is data loaded in loaders instead of effects?
2. Are mutations using Form/action patterns?
3. Are there error boundaries at appropriate route levels?
4. Is navigation declarative with Link components?
5. Are pending states properly handled?
Pliki w paczce (5)
  • SKILL.md 4 KB
  • references/data-loading.md 7 KB
  • references/error-handling.md 10 KB
  • references/mutations.md 11 KB
  • references/navigation.md 11 KB

Wersje

W bazie nie ma innych skilli o nazwie react-router-code-review.

Migawka bazy z 13.11.2026 · wersja paczki 9c4d35ec092f (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100react-router-framework-mode
    Buduje pełnostackowe aplikacje React Router w trybie framework: trasy, loadery, akcje, formularze, granice błędów i plik konfiguracyjny.
  • 100react-ui-patterns
    Opisuje nowoczesne wzorce UI w React dla stanów ładowania, obsługi błędów i pobierania danych asynchronicznych.
  • 100react-ui-patterns
    Opisuje nowoczesne wzorce UI w React dla stanów ładowania, obsługi błędów i pobierania danych asynchronicznych.
  • 100react-ui-patterns
    Opisuje nowoczesne wzorce UI w React dla stanów ładowania, obsługi błędów i pobierania danych asynchronicznych.
  • 100tanstack-router
    Obejmuje routing plikowy TanStack Router w React: definicje tras, layouty, guardy uwierzytelniania, loadery i typowaną nawigację.
  • 100code-showcase-react-ui-patterns
    Przedstawia nowoczesne wzorce interfejsu w React dla stanów ładowania, obsługi błędów i pobierania danych, przy budowie komponentów i obsłudze danych asynchronicznych.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.