mcpField
E
expo-react-native-javascript-best-practices

expo-react-native-javascript-best-practices

github.com/mindrallyDevelopment287783 installsUpdated 3w ago
Repository

About expo-react-native-javascript-best-practices

A skill offering JavaScript practices for building Expo React Native applications, aimed at developers seeking clean structure and better performance. It covers functional components, feature-based organization, responsive styling, and Expo deployment practices.

Key features

  1. 01Functional components and hooks
  2. 02Reusable feature-based organization
  3. 03JavaScript naming and style guidance
  4. 04Rendering and FlatList optimization
  5. 05Responsive styling and image guidance
  6. 06Expo EAS Build and OTA practices

Use cases

  1. 01Organizing a React Native app by feature
  2. 02Reducing unnecessary component re-renders
  3. 03Optimizing long FlatList screens
  4. 04Preparing Expo app deployment

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mindrally/skills --skill expo-react-native-javascript-best-practices

After installing, type/expo-react-native-javascript-best-practicesin Claude Code to confirm it loaded.

Details

From the project README

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

Comments

Markdown supported