Initial Setup
Create a new project:
npx create-expo-stack@latest
Development Setup
Configure Project Structure
my-app/
├── app/
│ ├── (tabs)/
│ ├── _layout.tsx
│ └── index.tsx
├── components/
├── assets/
├── hooks/
└── services/
Development Workflow
# Start development server
npx expo start
## Production Builds with EAS
### 1. Install Expo Development Client:
```bash
npx expo install expo-dev-client
2. Configure EAS Build
Create or modify eas.json
:
{
"build": {
"preview": {
"android": {
"buildType": "apk"
}
},
"production": {
"android": {
"buildType": "app-bundle"
}
}
}
}
3. Build Commands
# Android preview build
eas build -p android --profile preview
# iOS preview build
eas build -p ios --profile preview
# Production builds
eas build -p android --profile production
eas build -p ios --profile production
# Build for all platforms
eas build --platform all
4. Build Profiles
Common build profiles:
{
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal",
"android": {
"buildType": "apk"
}
},
"production": {
"android": {
"buildType": "app-bundle"
}
}
}
}
Deployment
1. Submit to Stores
# Submit to App Store
eas submit -p ios
# Submit to Play Store
eas submit -p android
2. Updates
Configure app.json
:
{
"expo": {
"updates": {
"enabled": true,
"fallbackToCacheTimeout": 0
}
}
}
Push updates:
eas update
Code Examples
Navigation (Expo Router)
// app/(tabs)/index.tsx
import { View, Text } from 'react-native';
export default function Home() {
return (
<View>
<Text>Home Screen</Text>
</View>
);
}
Styling (NativeWind)
// components/Button.tsx
import { Pressable, Text } from 'react-native';
export default function Button({ title }) {
return (
<Pressable className="bg-blue-500 px-4 py-2 rounded-lg">
<Text className="text-white font-medium">{title}</Text>
</Pressable>
);
}
Best Practices
-
Build Configuration
- Use appropriate build profiles
- Configure proper signing
- Implement version control
- Set up proper environment variables
-
Development
- Use TypeScript
- Follow consistent coding patterns
- Implement proper error handling
- Write maintainable code
-
Performance
- Optimize assets
- Implement caching
- Monitor bundle size
- Use performance monitoring
Troubleshooting
Common EAS build issues:
# View a list of build commands
eas build --help
# View build logs
eas build:list
eas build:view
# Cancel ongoing build
eas build:cancel
Future Features
Upcoming in create-expo-stack:
- NativeWindUI styling (May 2024)
- Vexo Analytics (June 2024)
- Enhanced testing (August 2024)
- Unified design system (September 2024)
- Dark mode support (October 2024)
Resources
- Official website: rn.new
- EAS documentation
- GitHub repository
- Discord community
Conclusion
Create Expo Stack, combined with EAS build system, provides a robust solution for React Native development and deployment. The platform's build tools and configuration options allow for flexible and efficient app development workflows.
Stay updated with:
- EAS documentation
- Platform updates
- Community resources
- Best practices
This setup ensures a streamlined development process from initial setup through production deployment.