react
Skill0 starsChanged 8 months agoMITView on GitHub
Core React 19 patterns for DSAI projects including hooks, Suspense, lazy loading, component structure with forwardRef, TypeScript best practices, and performance optimization. Use when working with React components, hooks, lazy loading, Suspense boundaries, or React-specific TypeScript patterns.
30 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- lobehub/lobehubtheir own version, first seen Oct 1, 2026
- compozy/compozytheir own version, first seen Oct 1, 2026
- vercel-labs/json-rendertheir own version, first seen Sep 23, 2026
- dafaalz/agent-skillstheir own version, first seen Sep 22, 2026
- AvilaCarlosDev/openclaw-skillstheir own version, first seen Sep 19, 2026
- danielteles/awesome-agent-skillstheir own version, first seen Sep 2, 2026
Used with
Projects with it also use app-renderer-systems, refactoring-analysis and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
pedronauckSkillapp-renderer-systems
Create, extend, or debug frontend domain modules organized under systems/. Covers adapters, Query hooks, local state, and public exports; excludes generic components and backend implementation.
Also in 3 projects that use this
pedronauckSkillrefactoring-analysis
Audit code quality and architectural health or plan refactoring using Fowler code smells and techniques; write prioritized findings to docs/_refacs/. Excludes formatting, performance, and security audits.
Also in 3 projects that use this
akornmeierSkilltailwindcss
Guide for implementing Tailwind CSS - a utility-first CSS framework for rapid UI development. Use when styling applications with responsive design, dark mode, custom themes, or building design systems with Tailwind's utility classes.
Also in 6 projects that use this
joabgonzalezSkillexpress
Express.js routing, middleware, and error handling. Trigger: When building REST APIs or server logic with Express.
Also in 3 projects that use this
barisariburnuSkilltanstack
Expert assistance for TanStack Router, Query (v5), and Table (v8). Use when users need help with file-based routing, type-safe navigation, data loading, search params, queries, mutations, optimistic updates, infinite queries, table state management, or debugging TanStack libraries.
Also in 3 projects that use this
MindrallySkillflutter
Expert in Flutter and Dart development with clean architecture and state management
Also in 3 projects that use this
- +1 more from pedronauck
Other versions30 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- michelve/hugin-cowork★ 169% same
Wrote their own version · 29
- lobehub/lobehub★ 83ksame name
- vercel-labs/json-render★ 18ksame name
- compozy/compozy★ 2.8ksame name
- openops-cloud/openops★ 1.1ksame name
- pedronauck/skills★ 633same name
- Mindrally/skills★ 266same name
- magnus919/agent-skills★ 109same name
- dylantarre/design-system-skills★ 50same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- sordi-ai/skill-everything★ 20same name
19 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- skills/react-best-practices/AGENTS.mdAGENTS.md
- accessibilitySkill
- adr-writerSkill
- automatic-code-reviewSkill
- component-visualizerSkill
- create-tasksSkill
- dsai-componentsSkill
- dsai-figmaSkill
- dsai-stylingSkill
- dsai-toolsSkill
- figma-code-connect-componentsSkill
- figma-create-design-system-rulesSkill
- figma-create-new-fileSkill
- figma-generate-designSkill
- figma-generate-librarySkill
- figma-implement-designSkill
- figma-useSkill
- miro-mcpSkill
- nodejsSkill
- playwright-skillSkill
- prismaSkill
- react-best-practicesSkill
- route-testerSkill
- setupSkill
- skill-creatorSkill
- skill-developerSkill
- sync-schemasSkill
- task-checkSkill
- web-design-guidelinesSkill
- writing-testsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Every component MUST have a displayName property
“Common” is measured: kept by at least 6 in 10 of the 23 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Core Patterns
When to Use
- Creating React components
- Working with hooks (useState, useEffect, custom hooks)
- Implementing Suspense boundaries
- Setting up lazy loading with React.lazy
- Using React 19 patterns (ref as prop, no forwardRef)
- Structuring component files
- Optimizing component performance
Purpose
Essential React 19 patterns for building modern applications with hooks, Suspense, lazy loading, and TypeScript.
Note: DSAI Component Convention (React 19):
forwardRefis REQUIRED for all DSAI components — usememo(forwardRef(function Name(props, ref)))pattern- Every component MUST have a
displayNameproperty - Props go in separate
*.types.tsfiles propTypesremoved (use TypeScript interfaces)- New JSX transform required
React.FCtype discouraged — use direct function components with typed props
When to Use This Skill
- Creating React components
- Using React hooks (useState, useEffect, useCallback, useMemo)
- Implementing lazy loading and code splitting
- Working with Suspense boundaries
- React-specific TypeScript patterns
- Performance optimization with React
Quick Start
Component Structure Template
import { forwardRef, memo, useState, useCallback } from 'react';
import { cn } from '@/lib/utils';
import type { UserProfileProps } from './UserProfile.types';
// Props defined in UserProfile.types.ts:
// interface UserProfileProps {
// userId: string;
// onUpdate?: (data: UserData) => void;
// className?: string;
// }
export const UserProfile = memo(
forwardRef<HTMLDivElement, UserProfileProps>(
function UserProfile({ userId, onUpdate, className }, ref) {
const [data, setData] = useState<UserData | null>(null);
const handleUpdate = useCallback((newData: UserData) => {
setData(newData);
onUpdate?.(newData);
}, [onUpdate]);
return (
<div ref={ref} className={cn('user-profile', className)}>
{/* Component content */}
</div>
);
}
)
);
UserProfile.displayName = 'UserProfile';Component Checklist
Creating a React component? Follow this:
- Use
memo(forwardRef(function Name(props, ref)))pattern - Set
displayNameon every component - Props in separate
*.types.tsfile - Use
cn()for class name composition (Bootstrap classes, not Tailwind) - Use
useCallbackfor event handlers passed to children - Use
useMemofor expensive computations - Lazy load if heavy component:
lazy(() => import()) - Wrap lazy components in
<Suspense>with fallback - Named export only (no default exports)
- No conditional hooks (hooks must be called in same order)
- Import from
@/components/ui/for DSAI components
Core Hooks Patterns
See hooks-patterns.md for useState, useCallback, useMemo, and useEffect patterns with TypeScript examples.
Lazy Loading & Code Splitting
See lazy-loading.md for React.lazy, Suspense fallbacks, and feature-based code splitting examples.
Suspense Patterns
Suspense Boundaries
// Wrap data-fetching components
<Suspense fallback={<Skeleton />}>
<UserProfile userId={id} />
</Suspense>
// Nested Suspense for granular loading
<Suspense fallback={<PageLoader />}>
<Header />
<Suspense fallback={<ContentSkeleton />}>
<MainContent />
</Suspense>
<Footer />
</Suspense>Error Boundaries with Suspense
import { ErrorBoundary } from 'react-error-boundary';
<ErrorBoundary fallback={<ErrorFallback />}>
<Suspense fallback={<Loading />}>
<DataComponent />
</Suspense>
</ErrorBoundary>TypeScript Patterns
See typescript-patterns.md for component props, hooks typing, and custom hook return types.
Performance Optimization
See performance.md for React.memo usage, custom comparison functions, and avoiding re-renders.
Common Patterns
Conditional Rendering
// Ternary operator
{isLoading ? <Spinner /> : <Content />}
// Logical AND
{error && <ErrorMessage error={error} />}
// Nullish coalescing
{user ?? <GuestView />}
// Early return for loading states
function Component() {
const { data } = useSomeHook();
// ❌ Avoid early returns for loading - breaks hooks rules
// Use Suspense instead
return <div>{data.map(...)}</div>;
}Lists and Keys
// Always use stable keys
{items.map(item => (
<ItemCard key={item.id} item={item} />
))}
// Never use index as key if list can reorder
// ❌ Bad
{items.map((item, index) => (
<ItemCard key={index} item={item} />
))}File Organization
Feature-Based Structure
src/client/
├── components/
│ ├── ui/ # DSAI components (installed via `dsai add`)
│ │ ├── button/
│ │ │ ├── Button.tsx
│ │ │ ├── Button.types.ts
│ │ │ ├── Button.fsm.ts
│ │ │ └── index.ts
│ │ ├── modal/
│ │ └── card/
│ └── features/ # App-specific feature components
│ ├── auth/
│ └── posts/
├── hooks/ # Shared hooks (DSAI + custom)
├── lib/
│ └── utils/ # Utilities (cn, validators, etc.)
└── types/ # Shared typesComponent Co-location
components/ui/button/
├── Button.tsx # Component with forwardRef + displayName
├── Button.types.ts # TypeScript prop interfaces
├── Button.fsm.ts # FSM reducer (interactive components)
├── Button.test.tsx # Unit tests (Jest 30 + RTL)
├── Button.a11y.test.tsx # Accessibility tests (jest-axe)
└── index.ts # Barrel exportsCommon Mistakes to Avoid
See common-mistakes.md for conditional hooks, missing dependencies, and state mutation anti-patterns.
Additional Resources
For more detailed patterns, see:
- component-patterns.md - Advanced component patterns
- performance.md - Performance optimization techniques
- typescript-patterns.md - TypeScript best practices
- hooks-patterns.md - Custom hooks and advanced patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

