Back to Rules
JavaScript

Expo React Native JavaScript Best Practices: Clean Code, Performance & Optimization Guide

Claude Directory November 29, 2025
2 copies 1 downloads

Master Expo React Native development with proven JavaScript best practices for readable code, efficient performance, modular components, and seamless UI styling to build high-quality mobile apps.

Rule Content
1. **Prioritize Readable and Maintainable Code**: Craft code that's straightforward to comprehend by choosing meaningful variable and function names. Opt for functional components paired with hooks like useState and useEffect, ditching class-based ones. Decompose large components into compact, reusable modules each handling one core task, and structure your project files around features (e.g., folders like user-profile or chat-interface).

2. **Adopt Consistent Naming Standards**: Employ camelCase for variables and functions (e.g., fetchUserData, processInput). Name components in PascalCase (e.g., UserDashboard, MessageList). Organize directories with lowercase and hyphens (e.g., user-dashboard, message-list) for clarity.

3. **Leverage Modern JavaScript and Avoid Pitfalls**: Steer clear of global variables to eliminate side effects. Harness ES6+ syntax such as arrow functions, object destructuring, and template strings for succinct, powerful code. Implement PropTypes for runtime prop validation in components when TypeScript isn't in play.

4. **Boost Performance Through Smart Techniques**: Minimize state changes by using local state judiciously and applying React.memo to curb redundant re-renders. Fine-tune FlatList with settings like removeClippedSubviews, maxToRenderPerBatch, and windowSize for smooth scrolling. Skip inline anonymous functions in render callbacks or handlers to avoid triggering extra renders.

5. **Implement Responsive and Efficient UI Styling**: Rely on StyleSheet.create for static styles or styled-components for flexibility. Design for diverse devices using adaptable units and tools like react-native-responsive-screen. Enhance image performance with libraries such as react-native-fast-image.

6. **Embrace Core Platform and Tooling Habits**: Respect React Native's threading for fluid UIs. Harness Expo's EAS Build, OTA updates, and Expo Router for streamlined routing, native navigation, deep links, and cross-platform support on iOS, Android, and web.

Comments

More Rules

View all
AI/ML

GLM-4.7 Optimized Config & System Prompt Designer

Expert system prompt for designing high-performance configurations tailored to GLM-4.7's strengths in coding, reasoning, tool use, and multilingual tasks, backed by benchmarks like SWE-bench and τ²-Bench.

C
Community
AI/ML

GLM-4.7 Open-Source Coding Expert: Optimized System Prompt

Leverage GLM-4.7's top benchmarks in SWE-bench, LiveCodeBench, and more with this system prompt designed for generating clean, secure, open-source-ready code, stunning UIs, and agentic workflows.

C
Community
AI/ML

GLM-4.7 Optimized Coding Agent

This system prompt transforms an AI into GLM-4.7, a benchmark-leading coding agent excelling in agentic workflows, tool use, multilingual coding, and complex reasoning with verified best practices for production-ready open-source development.

C
Community
DevOps

Agentic Dev Loop: Autonomous Jira-Driven Coding Agent with GitHub CI Self-Healing

Ralph, a persistent autonomous AI agent, implements Jira tickets through an endless loop until 100% test success, with GitHub PRs, Jules AI reviews, and CI self-healing for reliable development workflows.

C
Claude Directory
AI/ML

Türk Hukuku Uzmanı AI Agent: Güvenilir Yasal Danışman System Prompt

Claude'u Türk hukuku alanında dünyanın en önde gelen uzmanı olarak yapılandıran, yapılandırılmış yanıtlar, zorunlu uyarılar ve etik sınırlarla donatılmış profesyonel AI agent promptu.

C
Community
Database

PostgreSQL Best Practices: Expert Subagent Guide

Expert subagent providing production-ready PostgreSQL guidance on schema design, query optimization, security, performance tuning, and administration with structured, actionable advice and official references.

C
Claude Directory