A React Native app showcasing various animations and transitions.
src/
├── components/ # Shared components
├── constants/ # Global constants and configurations
├── hooks/ # Custom hooks
├── scenes/ # Individual animation scenes
│ ├── scene1/ # First scene
│ ├── scene2/ # Second scene
│ └── ... # Additional scenes
├── store/ # State management
└── theme/ # Theme configuration
-
Use
AnimatedViewfor animated components -
Use
Viewfor static components -
Use
Textfor text components -
Never use
StyleSheetfrom 'react-native' -
Use component props for styling:
// ❌ Don't do this: import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ ... }); <View style={styles.container} /> // ✅ Do this instead: <View flex={1} backgroundColor='white' alignItems='center'>
- Always use string literals for theme colors (e.g.,
theme.colors.white) - Use component props for styling instead of StyleSheet
- Follow consistent styling patterns across components
-
Create new scene directory in
src/scenes/ -
Add scene configuration to
src/constants/scenes.ts -
Create scene component with proper imports and types
-
Add scene to
src/App.tsx:import { SceneX } from 'scenes/sceneX'; function MainContent() { const { currentScene } = useAppStore(); return ( <View style={styles.container}> {currentScene === 'sceneX' && <SceneX />} <StatusBar style='auto' /> </View> ); }
Each scene must have configuration in src/constants/scenes.ts:
sceneX: {
// Required fields
animation1: number, // Duration in ms
animation2?: number, // Optional secondary animation
delay?: number, // Optional initial delay
// Scene-specific fields
...
}- Use
useCompletehook for scene completion - Use AppStore's
nextScenefor transitions