prmbr-image-mksaas/.cursor/rules/react-best-practices.mdc
javayhu 59ae1d9830 chore: update best practices documentation for various technologies
- Refine and expand best practices for:
  - AI SDK
  - Date-fns
  - Next.js
  - Radix UI
  - React
  - React Hook Form
  - Stripe
  - Tailwind CSS
  - TypeScript
  - Zustand
- Improve guidelines with more specific and actionable recommendations
- Enhance type safety and performance suggestions across different technologies
2025-03-09 08:44:53 +08:00

13 lines
639 B
Plaintext

---
description: Best practices for React component development
globs: **/*.{ts,tsx,js,jsx}
alwaysApply: false
---
- Use functional components with hooks instead of class components for better performance and readability
- Implement proper state management using using libraries like Zustand for complex state scenarios
- Utilize React 19's new features like `use` hook for better data fetching and suspense integration
- Ensure proper prop type validation using TypeScript for enhanced type safety
- Utilize `useCallback` and `useMemo` for performance optimization
- Leverage `react-hook-form` for efficient form handling and validation