Mobile react native

From williamzujkowski/standards · View interactive version

Mobile react native is an AI agent skill from the GitHub repository williamzujkowski/standards. React Native mobile development covering iOS and Android cross-platform apps, navigation, state management, native modules, and performance optimization for production-ready mobile applications

How to use this skill

Skill file

React Native Mobile Development

Level 1: Quick Reference (~700-900 tokens)

Level 2: Implementation Guide (~4000-5000 tokens)

Level 3: Deep Dive Resources (external links)


Level 1: Quick Reference

Core Components

import { View, Text, ScrollView, FlatList, Image, TouchableOpacity } from 'react-native';

// Basic Layout
<View style={styles.container}>
  <Text style={styles.title}>Hello World</Text>
  <Image source={require('./logo.png')} style={styles.image} />
  <TouchableOpacity onPress={handlePress}>
    <Text>Press Me</Text>
  </TouchableOpacity>
</View>

// List Rendering (Performance Optimized)
<FlatList
  data={items}
  renderItem={({ item }) => <ItemCard item={item} />}
  keyExtractor={item => item.id}
  onEndReached={loadMore}
  onEndReachedThreshold={0.5}
/>

// Scrollable Content
<ScrollView contentContainerStyle={styles.scrollContent}>
  {/* Long content */}
</ScrollView>

Navigation (React Navigation v6)

// Stack Navigator
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();

function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen name="Home" component={HomeScreen} />
        <Stack.Screen name="Details" component={DetailsScreen} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

// Navigate Between Screens
navigation.navigate('Details', { itemId: 42 });
navigation.goBack();

Styling

import { StyleSheet } from 'react-native';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
  text: {
    fontSize: 16,
    color: '#333',
    fontWeight: 'bold',
  },
});

Platform-Specific Code

import { Platform } from 'react-native';

const styles = StyleSheet.create({
  container: {
    marginTop: Platform.OS === 'ios' ? 20 : 0,
    ...Platform.select({
      ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 2 } },
      android: { elevation: 4 },
    }),
  },
});

// Platform-specific files
// Button.ios.tsx
// Button.android.tsx

Essential Checklist


Level 2:

📚 Full Examples: See REFERENCE.md for complete code samples, detailed configurations, and production-ready implementations.

Implementation Guide

1. Core Components and APIs

Layout Components

See REFERENCE.md for complete implementation.

Interactive Components

See REFERENCE.md for complete implementation.

Input Components

See REFERENCE.md for complete implementation.

List Components

See REFERENCE.md for complete implementation.

2. Navigation Architecture

React Navigation v6 Setup

See REFERENCE.md for complete implementation.

Tab Navigation

See REFERENCE.md for complete implementation.

Drawer Navigation

See REFERENCE.md for complete implementation.

3. State Management

Redux Toolkit

See REFERENCE.md for complete implementation.

Zustand (Lightweight Alternative)

See REFERENCE.md for complete implementation.

React Query (Server State)

See REFERENCE.md for complete implementation.

4. Styling and Theming

StyleSheet API

See REFERENCE.md for complete implementation.

Styled Components

See REFERENCE.md for complete implementation.

Responsive Design

See REFERENCE.md for complete implementation.

5. Platform-Specific Code

Platform API

See REFERENCE.md for complete implementation.

File Extensions

See REFERENCE.md for complete implementation.

Conditional Rendering

See REFERENCE.md for complete implementation.

6. Native Modules and Bridges

Using Native Modules

See REFERENCE.md for complete implementation.

Linking to Native APIs

See REFERENCE.md for complete implementation.

7. Performance Optimization

Component Optimization

See REFERENCE.md for complete implementation.

FlatList Optimization

See REFERENCE.md for complete implementation.

InteractionManager

See REFERENCE.md for complete implementation.

Image Optimization

See REFERENCE.md for complete implementation.

8. Testing

Jest Unit Tests

See REFERENCE.md for complete implementation.

React Native Testing Library

See REFERENCE.md for complete implementation.

E2E Testing (Detox)

See REFERENCE.md for complete implementation.

9. Accessibility

Screen Reader Support

See REFERENCE.md for complete implementation.

Semantic Labels

See REFERENCE.md for complete implementation.

10. Deployment

iOS App Store

See REFERENCE.md for complete implementation.

Android Play Store

See REFERENCE.md for complete implementation.

Over-the-Air (OTA) Updates

See REFERENCE.md for complete implementation.


Level 3: Deep Dive Resources

Official Documentation

Performance

Testing

State Management

Native Modules

Deployment

Examples

Basic Usage

// TODO: Add basic example for mobile-react-native
// This example demonstrates core functionality

Advanced Usage

// TODO: Add advanced example for mobile-react-native
// This example shows production-ready patterns

Integration Example

// TODO: Add integration example showing how mobile-react-native
// works with other systems and services

See examples/mobile-react-native/ for complete working examples.

Integration Points

This skill integrates with:

Upstream Dependencies

Downstream Consumers

Related Skills

Common Integration Patterns

  1. Development Workflow: How this skill fits into daily development
  2. Production Deployment: Integration with production systems
  3. Monitoring & Alerting: Observability integration points

Common Pitfalls

Pitfall 1: Insufficient Testing

Problem: Not testing edge cases and error conditions leads to production bugs

Solution: Implement comprehensive test coverage including:

Prevention: Enforce minimum code coverage (80%+) in CI/CD pipeline

Pitfall 2: Hardcoded Configuration

Problem: Hardcoding values makes applications inflexible and environment-dependent

Solution: Use environment variables and configuration management:

Prevention: Use tools like dotenv, config validators, and secret scanners

Pitfall 3: Ignoring Security Best Practices

Problem: Security vulnerabilities from not following established security patterns

Solution: Follow security guidelines:

Prevention: Use security linters, SAST tools, and regular dependency updates

Best Practices:


Quick Links to Templates

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.