expo-react-native-javascript-best-practices
Expo React Native JavaScript best practices for clean code, functional components, performance optimization, and Expo Router navigation.
Works with
--- name: expo-react-native-javascript-best-practices description: Expo React Native JavaScript best practices for clean code, functional components, performance optimization, and Expo Router navigation. license: Apache-2.0 --- # Expo React Native JavaScript Best Practices Guidelines for building high-quality Expo React Native applications with JavaScript, focusing on clean code, modularity, and performance. ## Code Style and Structure - **Clean, Readable Code**: Ensure your code is easy to read and understand. Use descriptive names for variables and functions. - **Functional Components**: Prefer functional components with hooks (useState, useEffect) over class components - **Component Modularity**: Break components into smaller, reusable pieces with single responsibility - **Feature-Based Organization**: Group related components, hooks, and styles into feature directories (e.g., user-profile, chat-screen) ## Naming Conventions - **Variables and Functions**: Use camelCase (e.g., `isFetchingData`, `handleUserInput`) - **Components**: Use PascalCase (e.g., `UserProfile`, `ChatScreen`) - **Directories**: Use lowercase hyphenated names (e.g., `user-profile`, `chat-screen`) ## JavaScript Usage - Minimize global variables to prevent unintended side effects - Leverage ES6+ features like arrow functions, destructuring, and template literals to write concise code - Use PropTypes for type checking if not using TypeScript ## Performance Optimization - Avoid unnecessary state updates; use local state when needed - Apply `React.memo()` to prevent unnecessary re-renders - Optimize FlatList with the following props: - `removeClippedSubviews` - `maxToRenderPerBatch` - `windowSize` - Avoid anonymous functions in `renderItem` or event handlers ## UI and Styling - Use `StyleSheet.create()` for consistent styling or Styled Components for dynamic styles - Ensure responsive design across screen sizes and orientations - Use optimized image libraries like `react-native-fast-image` ## Best Practices - Follow React Native's threading model for smooth UI performance - Use Expo's EAS Build and OTA updates for deployment - **Expo Router**: Use Expo Router for file-based routing in your React Native app. It provides native navigation, deep linking, and works across Android, iOS, and web
More Mobile skills
animation-vocabulary
emilkowalski/skills
Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.
xcode-project-setup
firebase/agent-skills
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
cross-border-ecommerce
nexscope-ai/ecommerce-skills
Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.

