skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
eyadsibai/ltk60 installs

React

This skill should be used when the user asks about "React", "React components", "React hooks", "useState", "useEffect", "JSX", "React patterns", "React best practices", or mentions React development.

How do I install this agent skill?

npx skills add https://github.com/eyadsibai/ltk --skill react
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides educational guidance and architectural patterns for React development. It is purely informational and contains no executable code or security risks.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerpass

    1 file scanned · No issues

What does this agent skill do?

React Development

Guidance for building React applications with modern patterns.


Hooks Reference

Built-in Hooks

HookPurposeWhen to Use
useStateLocal stateSimple values, toggles, form inputs
useReducerComplex stateMultiple sub-values, state machines
useEffectSide effectsData fetching, subscriptions, DOM manipulation
useContextConsume contextTheme, auth, global state
useRefMutable referenceDOM access, persist values across renders
useMemoMemoize valueExpensive calculations
useCallbackMemoize functionStable callbacks for child components
useLayoutEffectSync DOM effectsMeasure DOM before paint
useIdUnique IDsAccessibility, form labels

Hook Rules

RuleWhy
Only call at top levelHooks rely on call order
Only call from React functionsComponents or custom hooks
Name custom hooks with "use"Convention for linting

Component Patterns

PatternUse CaseKey Concept
PresentationalPure UI, no logicProps in, JSX out
ContainerData fetching, stateWraps presentational
Compound ComponentsRelated components sharing stateParent provides context
Render PropsShare behaviorFunction as child
Custom HooksReusable stateful logicExtract from components
HOCLegacy patternPrefer hooks instead

State Management Decision

SolutionBest ForTrade-offs
useStateComponent-localSimplest, prop drilling for sharing
useReducerComplex local stateMore boilerplate, predictable
ContextTheme, auth, i18nRe-renders all consumers
ZustandSimple globalMinimal API, good devtools
Redux ToolkitComplex globalPowerful, more boilerplate
React Query/TanStackServer stateCaching, background refresh
Jotai/RecoilAtomic stateFine-grained updates

Key concept: Server state (API data) and client state (UI state) should be managed differently. Use React Query for server state.


useEffect Patterns

PatternDependency ArrayPurpose
Run once[]Initial fetch, setup
Run on change[dep1, dep2]React to specific changes
Run every render(omit)Rarely needed
CleanupReturn functionSubscriptions, timers

Common Pitfalls

PitfallSolution
Infinite loopsInclude all dependencies, use useCallback
Stale closuresUse refs or functional updates
Race conditionsCleanup flag or AbortController
Missing depsTrust the linter, refactor if needed

Performance Optimization

TechniqueWhen to UseCost
React.memoExpensive child, frequent parent rendersShallow comparison
useMemoExpensive calculationMemory for cached value
useCallbackCallback passed to memoized childMemory for function
Lazy loadingLarge components, routesInitial load vs waterfall
VirtualizationLong lists (100+ items)Complexity

Key concept: Don't optimize prematurely. Measure first with React DevTools Profiler.


Conditional Rendering

PatternUse Case
&&Show/hide single element
TernaryTwo alternatives
Early returnMultiple conditions, cleaner
Switch/object mapMany alternatives

Form Handling

ApproachUse Case
ControlledNeed validation, formatting
Uncontrolled (refs)Simple forms, performance
React Hook FormComplex forms, validation
FormikLegacy, full-featured

Key concept: Controlled components store value in React state. Uncontrolled use DOM as source of truth.


Project Structure

DirectoryPurpose
components/ui/Generic, reusable (Button, Card)
components/features/Feature-specific compositions
hooks/Custom hooks
contexts/React contexts + providers
pages/ or routes/Route components
services/ or api/API calls, data fetching
types/TypeScript types
utils/Pure helper functions

Best Practices

PracticeWhy
Keep components small (<100 lines)Readable, testable
Colocate related codeEasier to maintain
Lift state only when neededAvoid unnecessary complexity
Use TypeScript for propsCatch errors, better DX
Prefer composition over inheritanceReact's design philosophy
Extract custom hooksReusable logic, testable

Resources

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/eyadsibai/ltk/react">View React on skillZs</a>