react-best-practices
Skill30 starsChanged 53 days agoMITView on GitHub
React component patterns, hooks, state management, and performance best practices. Use when building or reviewing React components.
66 other projects use a version of this.
Adopted by
Most recently taken up by
- eea/eea.agent.skillstheir own version, first seen Nov 8, 2026
- amanuelmamo7/Skillstheir own version, first seen Nov 7, 2026
- drinkspiller/skillstheir own version, first seen Nov 6, 2026
- tylergibbs1/codewardentheir own version, first seen Nov 1, 2026
- sbrudz/agent-skillstheir own version, first seen Nov 1, 2026
- poizoncoded/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use composition-patterns, python-best-practices 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.
eeaSkillcomposition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
Also in 4 projects that use this
jefflesterSkillpython-best-practices
Python development best practices including PEP 8 style guidelines, type hints, docstring conventions, and common patterns. Use when writing or modifying Python code.
Also in 3 projects that use this
MicrosoftSkillplanning-with-files
**USE THIS FOR COMPLEX TASKS.** Implements Manus-style file-based planning for multi-step tasks. Creates task_plan.md, findings.md, and progress.md in .agent_cache/<task-name>/. Use when: implementing multiple APIs, refactoring modules, research tasks, or ANY task requiring >5 tool calls.
Also in 5 projects that use this
VercelSkillvercel-deploy
Deploy applications and websites to Vercel with a claimable preview. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment". No authentication required - returns preview URL and claimable deployment link.
Also in 3 projects that use this
MicrosoftSkillcode-quality
Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.
Also in 5 projects that use this
ttmouseSkillnotebooklm
Automate Google NotebookLM - create notebooks, add sources, generate podcasts/videos/quizzes, download artifacts. Supports browser-based content extraction for anti-crawler platforms (Twitter/X, LinkedIn, etc.). Activates on explicit /notebooklm or intent like "create a podcast about X
Also in 3 projects that use this
- +1 more from microsoft
Other versions66 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 66
- mastra-ai/mastra★ 29ksame name
- openai/plugins★ 7.8ksame name
- ryokun6/ryos★ 1.3ksame name
- involvex/youtube-music-cli★ 477same name
- vercel/vercel-plugin★ 328same name
- mikeOnBreeze/cc-crossbeam★ 297same name
- typv/nest-turbo-starter★ 224same name
- AvivK5498/Beads-Kanban-UI★ 102same name
- mxyhi/token_proxy★ 94same name
- laguagu/claude-code-nextjs-skills★ 72same name
56 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.
- AGENTS.mdAGENTS.md
- claude/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- api-design-patternsSkill
- auth-patternsSkill
- backend-dev-guidelinesSkill
- brainstormingSkill
- code-review-patternsSkill
- deployment-guideSkill
- docker-patternsSkill
- docx-officialSkill
- frontend-designSkill
- github-actionsSkill
- git-workflowSkill
- nestjs-patternsSkill
- nextjs-app-routerSkill
- pdf-officialSkill
- pptx-officialSkill
- prisma-workflowSkill
- prompt-engineeringSkill
- security-checklistSkill
- skill-creatorSkill
- software-architectureSkill
- systematic-debuggingSkill
- tailwind-patternsSkill
- test-driven-developmentSkill
- typescript-patternsSkill
- webapp-testingSkill
- web-design-guidelinesSkill
- xlsx-officialSkill
The file
Files
React Best Practices
Component Patterns
Functional Components Only
// ✅ Correct
interface UserCardProps {
user: User
onSelect: (id: string) => void
}
export const UserCard = ({ user, onSelect }: UserCardProps) => {
return (
<button onClick={() => onSelect(user.id)} className="...">
{user.name}
</button>
)
}
// ❌ Never use class components
class UserCard extends React.Component {}Composition Over Props Drilling
// ✅ Use composition
export const Layout = ({ children }: { children: React.ReactNode }) => (
<div className="layout">{children}</div>
)
// ✅ Use context for deep data
const ThemeContext = createContext<Theme | null>(null)
export const useTheme = () => {
const theme = useContext(ThemeContext)
if (!theme) throw new Error('useTheme must be used within ThemeProvider')
return theme
}Hooks
Custom Hooks
// ✅ Extract reusable logic into hooks
const useLocalStorage = <T>(key: string, initial: T) => {
const [value, setValue] = useState<T>(() => {
try {
const item = localStorage.getItem(key)
return item ? JSON.parse(item) : initial
} catch {
return initial
}
})
const set = (val: T) => {
setValue(val)
localStorage.setItem(key, JSON.stringify(val))
}
return [value, set] as const
}useEffect Rules
// ✅ Correct — explicit dependencies
useEffect(() => {
fetchUser(userId)
}, [userId])
// ✅ Cleanup when needed
useEffect(() => {
const sub = subscribe(channel)
return () => sub.unsubscribe()
}, [channel])
// ❌ Never ignore the dependency array
useEffect(() => {
fetchUser(userId)
}) // runs on every renderPerformance
Memoization
// ✅ Memoize expensive computations
const sorted = useMemo(
() => items.sort((a, b) => a.name.localeCompare(b.name)),
[items]
)
// ✅ Stable callback references
const handleClick = useCallback((id: string) => {
onSelect(id)
}, [onSelect])
// ✅ Prevent unnecessary re-renders
export const HeavyList = memo(({ items }: { items: Item[] }) => (
<ul>{items.map(item => <li key={item.id}>{item.name}</li>)}</ul>
))Code Splitting
// ✅ Lazy load heavy components
const Dashboard = lazy(() => import('./Dashboard'))
export const App = () => (
<Suspense fallback={<Spinner />}>
<Dashboard />
</Suspense>
)Error Handling
// ✅ Error boundaries for UI errors
export class ErrorBoundary extends React.Component<
{ children: ReactNode; fallback: ReactNode },
{ hasError: boolean }
> {
state = { hasError: false }
static getDerivedStateFromError() { return { hasError: true } }
render() {
return this.state.hasError ? this.props.fallback : this.props.children
}
}Forbidden Patterns
- Class components (use functional)
anytypes on props- Mutating state directly
- Missing
keyprops in lists - Ignoring cleanup in
useEffect useEffectfor derived state (useuseMemo)
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.

