agentleFS
MindrallyMindrally/skills/expo-react-native-javascript-best-practices/SKILL.md

expo-react-native-javascript-best-practices

Skill266 starsChanged 10 months agoApache-2.0View on GitHub

Expo React Native JavaScript best practices for clean code, functional components, performance optimization, and Expo Router navigation.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Clean, Readable Code: Ensure your code is easy to read and understand.

    line 12
  2. Distinctive:

    Functional Components: Prefer functional components with hooks (useState, useEffect) over class components

    line 13
  3. Very specific:

    Variables and Functions: Use camelCase (e.g., isFetchingData, handleUserInput)

    line 19
  4. Very specific:

    Components: Use PascalCase (e.g., UserProfile, ChatScreen)

    line 20
  5. Very specific:

    Directories: Use lowercase hyphenated names (e.g., user-profile, chat-screen)

    line 21
  6. Distinctive:

    Use PropTypes for type checking if not using TypeScript

    line 27
  7. Distinctive:

    Avoid unnecessary state updates.

    line 31
  8. Very specific:

    Avoid anonymous functions in renderItem or event handlers

    line 37
  9. Very specific:

    Use StyleSheet.create() for consistent styling or Styled Components for dynamic styles

    line 41
  10. Distinctive:

    Ensure responsive design across screen sizes and orientations

    line 42
  11. Very specific:

    Use optimized image libraries like react-native-fast-image

    line 43
  12. Distinctive:

    Follow React Native's threading model for smooth UI performance

    line 47
  13. Distinctive:

    Use Expo's EAS Build and OTA updates for deployment

    line 48
  14. Distinctive:

    Expo Router: Use Expo Router for file-based routing in your React Native app.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.