Skip to main content
rule

react-redux-typescript-cursorrules-prompt-file — Cursor rule

This Cursor rule guides React work with Redux and TypeScript, covering component style, state structure, and typed hooks. Use it in a matching project.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/react-redux-typescript-cursorrules-prompt-file.mdc
Open on GitHub

What react-redux-typescript-cursorrules-prompt-file does

The rule steers React code toward functional components with hooks and TypeScript checks. For state management, it calls for Redux Toolkit, slice-based organization, selectors, createAsyncThunk, typed Redux hooks, and error handling around async work.

It lays out src/components, src/features, src/store/slices, src/types, and src/utils, along with src/store/hooks.ts and src/store/store.ts. It also points to Redux DevTools and Redux naming conventions. The metadata uses globs: **/* while setting alwaysApply: false, so Cursor does not force the rule into every request.

What it helps with

  • structure React components around functions and hooks
  • split Redux state into slices under store
  • type state access with selectors and Redux hooks
  • handle async work through createAsyncThunk
  • review a React project against Redux naming guidance

Example prompts for the agent

  • Use this rule and build a React component with typed props and hooks.
  • Organize the state into Redux slices, add createAsyncThunk for data loading, and handle failures.
  • Review the project layout, move state code into src/store, and add typed hooks with selectors.

How to install react-redux-typescript-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/react-redux-typescript-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about react-redux-typescript-cursorrules-prompt-file

How do I install react-redux-typescript-cursorrules-prompt-file in Cursor?

Save the rule at .cursor/rules/react-redux-typescript-cursorrules-prompt-file.mdc in the project.

What does react-redux-typescript-cursorrules-prompt-file do?

It gives Cursor guidance for React projects using Redux and TypeScript, including functional components, Redux Toolkit, slices, selectors, typed hooks, and async error handling.

Does the rule apply to every project file?

Its glob is **/*, but alwaysApply: false means Cursor does not force it into every request.

Source text

react-redux-typescript-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for React development with Redux and TypeScript integration."
globs: **/*
alwaysApply: false
---
// React + Redux + TypeScript .cursorrules

// Prefer functional components with hooks

const preferFunctionalComponents = true;

// Use TypeScript for type safety

const useTypeScript = true;

// Redux best practices

const reduxBestPractices = [
  "Use Redux Toolkit for efficient Redux development",
  "Implement slice pattern for organizing Redux code",
  "Utilize createAsyncThunk for handling async actions",
  "Use selectors for accessing state in components",
];

// Folder structure

const folderStructure = `
src/
  components/
  features/
  store/
    slices/
    hooks.ts
    store.ts
  types/
  utils/
`;

// Additional instructions

const additionalInstructions = `
1. Use React.FC for functional components with props
2. Implement strict TypeScript checks
3. Use Redux hooks (useSelector, useDispatch) in components
4. Create reusable typed hooks for Redux operations
5. Implement proper error handling in async operations
6. Use Redux DevTools for debugging
7. Follow Redux style guide for naming conventions
`;

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set210

react-tanstack-router-query Guides AI assistants on structuring React SPAs with TanStack Router v1 and TanStack Query v5 to fetch data in loaders before rendering. ★ 41,024repo stars react-tanstack-router-query-cursorrules-prompt-file This rule describes a React SPA setup where TanStack Router handles navigation and TanStack Query stores server data. Use it to fetch route data before rendering a page. ★ 41,024repo stars react-styled-components-cursorrules-prompt-file A Cursor rule that tells the agent how to write React code with styled-components: functional components, theming through ThemeProvider, a fixed folder layout. ★ 41,024repo stars react-router-v7 Enforces React Router v7 conventions for route modules, deterministic loaders, action mutations, and typed routing in Cursor. ★ 41,024repo stars react-query-cursorrules-prompt-file A Cursor rule that tells the agent how to write React Query code: where QueryClient lives, how hooks and query keys are named. ★ 41,024repo stars react-nextjs-ui-development-cursorrules-prompt-fil Configures Cursor for React and Next.js App Router development. Forces the agent to outline pseudocode first and maintain dual Vercel and Replit support. ★ 41,024repo stars react-native-expo-router-typescript-windows-cursorrules-prompt-file This rule guides React Native projects using Expo, TypeScript, and Expo Router. It also covers NativeWind and Tailwind CSS versions, Babel configuration, and Windows terminal commands. ★ 41,024repo stars react-native-expo-cursorrules-prompt-file A Cursor rule that tells the agent how to write React Native code with Expo. Useful when you want new screens and components to follow one stack. ★ 41,024repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor