Cursor Rules for
React

This rule explains React component patterns, hooks usage, and best practices.
Back to rules
Type
Frontend
Language(s)
JavaScript
TypeScript
Tags
Framework
Stats
876 views
1,083 copies
960 downloads
react.mdc
---
description: This rule explains React component patterns, hooks usage, and best practices.
globs: **/*.jsx,**/*.tsx
alwaysApply: false
---

# React rules

- Use functional components with hooks instead of class components
- Use custom hooks for reusable logic
- Use the Context API for state management when needed
- Use proper prop validation with PropTypes
- Use React.memo for performance optimization when necessary
- Use fragments to avoid unnecessary DOM elements
- Use proper list rendering with keys
- Prefer composition over inheritance
Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later