React Functional Patterns — Free Cursor Rules Template
    Neura MarketNeura Market/Cursor
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityExtensionsTrending
    CursorRulesReact Functional Patterns
    Back to Rules
    Frontend

    React Functional Patterns

    April 15, 2026
    0 copies 0 downloads

    import { useState, useEffect, useMemo } from 'react';

    Rule Content
    You are an expert in React functional patterns, enforcing best practices.
    
    ## Component Structure
    
    ```typescript
    // ✅ REQUIRED STRUCTURE
    import { useState, useEffect, useMemo } from 'react';
    import * as S from './Component.styled';
    import { ComponentProps } from './Component.types';
    
    /**
     * Brief component description
     */
    export const Component = ({ prop1, prop2 }: ComponentProps): JSX.Element => {
        // 1. Hooks first (useState, useEffect, useMemo, custom hooks)
        const [state, setState] = useState(initialValue);
        
        // 2. Derived values
        const derivedValue = useMemo(() => compute(state), [state]);
        
        // 3. Event handlers
        const handleClick = () => {
            setState(newValue);
        };
        
        // 4. Effects
        useEffect(() => {
            // side effects
        }, [dependencies]);
        
        // 5. Render
        return (
            <S.Container>
                <S.Content onClick={handleClick}>
                    {derivedValue}
                </S.Content>
            </S.Container>
        );
    };
    ```
    
    ## Naming Conventions
    
    | Type | Convention | Example |
    |------|------------|---------|
    | Components | PascalCase | UserProfile |
    | Event handlers (internal) | handle* | handleClick |
    | Event handlers (props) | on* | onClick |
    | Boolean props | is*, has*, can* | isActive |
    | Styled components | S.* | S.Container |
    | Types/Interfaces | PascalCase with I prefix | IUserProfile |
    
    ## Prop Patterns
    
    ```typescript
    // ✅ Destructure props
    const Component = ({ name, isActive }: Props) => { ... };
    
    // ❌ Avoid props object access
    const Component = (props: Props) => {
        return <div>{props.name}</div>;  // Less readable
    };
    ```
    
    ## Conditional Rendering
    
    ```typescript
    // ✅ Early returns for guard clauses
    if (!data) return <Loading />;
    if (error) return <Error message={error} />;
    
    return <Content data={data} />;
    
    // ✅ Ternary for inline conditions
    {isActive ? <Active /> : <Inactive />}
    
    // ✅ Logical AND for conditional display
    {hasItems && <ItemList items={items} />}
    ```
    
    Part of Buddy OS: npx buddy-os | https://github.com/sharath317/buddy-os

    Tags

    reactfunctional componentshooksbest practices

    Comments

    More Rules

    View all

    Kechwafflesnew Cursor Rules

    C
    CODEFORYOU69

    AI DRAMA FACTORY Cursor Rules

    R
    Robert0157

    Site Cursor Rules

    R
    RaphaelVitoi

    KindnessBot Cursor Rules

    F
    foodyogi

    Neptunik Cursor Rules

    F
    fjpedrosa

    Cvcraft Cursor Rules

    C
    CedricCT

    Stay up to date

    Get the latest Cursor prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Cursor and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Cursor resource

    • Extract Text from Images & PDFs via Telegram with Mistral OCR to Markdownn8n · $24.99 · Related topic
    • Extract Data from YAPE Receipts via Telegram OCR and Store in Google Sheetsn8n · $24.99 · Related topic
    • Import Google Keep Notes to Google Sheets Using OpenAI and Google Driven8n · $14.99 · Related topic
    • Microsoft Outlook AI Email Assistant with Contact Support from Monday and Airtablen8n · $14.99 · Related topic
    Browse all workflows