npx agentspec-cli install 9cd24587-348e-4798-9c8e-c538b006a20e --file-type cursor-rules→ .cursor/rules/
# Quick Reference: React 19 + Next.js 15
## 🚨 Critical Rules
### 1. Always Use React 19 Patterns
```javascript
// ❌ OLD (React 18)
import { useFormState } from "react-dom";
// ✅ NEW (React 19)
import { useActionState } from "react";
```
### 2. Required next.config.js
```javascript
const nextConfig = {
turbopack: {
resolveAlias: {
react: "react",
"react-dom": "react-dom",
},
resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
};
```
### 3. Development Command
```bash
npm run dev # Must use --turbo flag
```
## 🔧 Quick Fixes
### Form State Error
```javascript
// Replace this
const [state, formAction] = useFormState(action, initial);
// With this
const [state, formAction] = useActionState(action, initial);
```
### Turbopack Warning
Add to next.config.js:
```javascript
turbopack: { /* config above */ }
```
## 📦 Version Lock
```json
{
"react": "^19.0.0",
"react-dom": "^19.0.0",
"next": "^15.1.0"
}
```
---
💡 **Need help?** Check `docs/REACT_NEXTJS_COMPATIBILITY_RULES.md`Nextjs React Typescript Cursorrules Prompt File Rules
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler
Trustednext Configuration
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler
Next.js 16/React 19 Architecture Rules
1. **NO `middleware.ts` ALLOWED:** As of Next.js 16+, the standard edge router interceptor must NEVER be named `middleware.ts`. It has been formally deprecated. You MUST write interception logic inside `src/proxy.ts` (or `proxy.ts`). If you generate a `middleware.ts` it will crash the Turbopack dev server and compilation due to file convention errors.
by AgentHub Crawler
Sign in to leave a comment.
React Typescript Nextjs Nodejs Cursorrules Prompt Rules
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler