Install any skill in seconds. Free to start, no credit card required.
Get Started Free →React useEffect best practices from official docs. Use when writing/reviewing useEffect, useState for derived values, data fetching, or state synchronization. Teaches when NOT to use Effect and better alternatives.
.claude/skills/davila7-react-useeffect/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | -44% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 19% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -6% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 4% | 0% |
| case-04 | ✓→✓ | = Same ✓ | -8% | 0% |
Effects are an escape hatch from React. They let you synchronize with external systems. If there is no external system involved, you shouldn't need an Effect.
| Situation | DON'T | DO | |-----------|-------|-----| | Derived state from props/state | useState + useEffect | Calculate during render | | Expensive calculations | useEffect to cache | useMemo | | Reset state on prop change | useEffect with setState | key prop | | User event responses | useEffect watching state | Event handler directly | | Notify parent of changes | useEffect calling onChange | Call in event handler | | Fetch data | useEffect without cleanup | useEffect with cleanup OR framework |
useSyncExternalStore when possible)const fullName = firstName + ' ' + lastNameNeed to respond to something?
├── User interaction (click, submit, drag)?
│ └── Use EVENT HANDLER
├── Component appeared on screen?
│ └── Use EFFECT (external sync, analytics)
├── Props/state changed and need derived value?
│ └── CALCULATE DURING RENDER
│ └── Expensive? Use useMemo
└── Need to reset state when prop changes?
└── Use KEY PROP on component| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 10,839 | 8,722 | -20% | 1 | 1 | 0% | 1,681 | 1,996 | +19% | 0 | 0 | — |
case-02 | pass→pass | 12,845 | 9,957 | -22% | 1 | 1 | 0% | 2,219 | 2,082 | -6% | 0 | 0 | — |
case-03 | pass→pass | 10,849 | 8,900 | -18% | 1 | 1 | 0% | 2,031 | 2,115 | +4% | 0 | 0 | — |
case-04 | pass→pass | 7,839 | 5,025 | -36% | 1 | 1 | 0% | 1,411 | 1,305 | -8% | 0 | 0 | — |
case-05 | pass→pass | 10,920 | 6,626 | -39% | 1 | 1 | 0% | 1,961 | 1,712 | -13% | 0 | 0 | — |
case-06 | pass→pass | 13,823 | 5,779 | -58% | 1 | 1 | 0% | 2,262 | 1,484 | -34% | 0 | 0 | — |
case-07 | pass→pass | 11,274 | 7,526 | -33% | 1 | 1 | 0% | 1,892 | 1,706 | -10% | 0 | 0 | — |
case-08 | pass→pass | 12,069 | 6,672 | -45% | 1 | 1 | 0% | 1,858 | 1,573 | -15% | 0 | 0 | — |
case-09 | pass→pass | 9,325 | 6,291 | -33% | 1 | 1 | 0% | 1,598 | 1,528 | -4% | 0 | 0 | — |
case-10 | pass→pass | 19,401 | 6,979 | -64% | 1 | 1 | 0% | 2,394 | 1,531 | -36% | 0 | 0 | — |
case-11 | pass→pass | 5,099 | 5,029 | -1% | 1 | 1 | 0% | 857 | 1,262 | +47% | 0 | 0 | — |
case-12 | pass→pass | 4,187 | 3,798 | -9% | 1 | 1 | 0% | 711 | 1,140 | +60% | 0 | 0 | — |
case-13 | pass→pass | 12,846 | 10,984 | -14% | 1 | 1 | 0% | 2,363 | 2,490 | +5% | 0 | 0 | — |
case-14 | fail→fail | 11,818 | 7,297 | -38% | 1 | 1 | 0% | 2,014 | 1,717 | -15% | 0 | 0 | — |
case-15 | fail→pass | 12,601 | 4,889 | -61% | 1 | 1 | 0% | 2,186 | 1,235 | -44% | 0 | 0 | — |
case-16 | pass→pass | 10,652 | 5,278 | -50% | 1 | 1 | 0% | 1,887 | 1,371 | -27% | 0 | 0 | — |
case-17 | pass→pass | 12,152 | 6,227 | -49% | 1 | 1 | 0% | 1,915 | 1,510 | -21% | 0 | 0 | — |
case-18 | pass→pass | 8,297 | 4,197 | -49% | 1 | 1 | 0% | 1,477 | 1,222 | -17% | 0 | 0 | — |
case-19 | pass→pass | 10,539 | 5,342 | -49% | 1 | 1 | 0% | 1,794 | 1,427 | -20% | 0 | 0 | — |
case-20 | pass→pass | 10,038 | 6,735 | -33% | 1 | 1 | 0% | 1,783 | 1,561 | -12% | 0 | 0 | — |
case-21 | pass→pass | 9,033 | 7,262 | -20% | 1 | 1 | 0% | 1,522 | 1,661 | +9% | 0 | 0 | — |
case-22 | pass→pass | 11,947 | 11,866 | -1% | 1 | 1 | 0% | 2,320 | 2,693 | +16% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.