Install any skill in seconds. Free to start, no credit card required.
Get Started Free →aiskillstore/react-best-practices
Use when reading or writing React components (.tsx, .jsx files with React imports).
Passed 22 of 23 test cases with the skill, and 20 of 23 without it.
2 fixed20 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
This benchmark measured an earlier version of the skill.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
In our React client application, three separate UI widgets rendered on the same screen independently request the current user's notification count on mount. How should we fetch this client-side data to ensure duplicate HTTP requests are automatically deduplicated across components? Provide a custom hook example.
| Checked | Without skill | With skill |
|---|---|---|
| uses SWR hook for automatic request deduplication across components | Missed | Passed |
The instructions your model reads when the skill loads.
Inspect the installed React version, framework, data layer, and compiler configuration before choosing APIs. Preserve those choices unless changing them is part of the task.
For a slow interaction, expensive render, long list, or memoization decision, read rendering performance. For ordinary component work, use the guidance below; profiling the whole application is not a prerequisite for a small edit.
Use the project's framework loaders, server components, or query library when appropriate. If a fetch effect is needed, handle races, cancellation, errors, and loading. Do not introduce a data library solely to avoid one effect.
Start independent requests together when their failure semantics allow it. Avoid parent/child fetch waterfalls. Preserve loading, empty, failure, and stale-data states.
Lazy-load heavy optional UI when it improves initial delivery. Inspect actual chunk output before changing import style; a barrel import is not automatically expensive. Changes to TanStack query keys or mutations should follow the installed TanStack API.
useActionState / useFormStatus boundaries and provide error handling; an Action does not make arbitrary failures disappear.useOptimistic inside its action/transition context. Treat optimistic UI as provisional and reconcile failed or concurrent writes.use() reads need a stable promise from an appropriate cache/framework; avoid creating a new fetch promise during every render.document.startViewTransition calls on the same update. Retain reduced-motion behavior and a supported fallback.Exercise the affected interaction and relevant loading/error states. Run the project's applicable lint, typecheck, build, and tests. For performance changes, compare the same interaction before and after using the method in the linked reference.
test cases passed, vs 20 / 23 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.