cosmicstack-labs/react-native-patterns
Navigation, state management, native modules, performance, animations, and cross-platform strategies
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill react-native-patterns
Build performant cross-platform mobile apps with React Native.
src/
├── components/ # Reusable UI components
├── screens/ # Screen-level components
├── navigation/ # React Navigation config
├── services/ # API, storage, native modules
├── hooks/ # Custom hooks
├── store/ # State management
├── utils/ # Helpers
└── types/ # TypeScript types
// Stack + Tab pattern
const RootStack = createNativeStackNavigator();
const MainTabs = createBottomTabNavigator();
function App() {
return (
<NavigationContainer>
<RootStack.Navigator>
<RootStack.Screen name="Main" component={MainTabs} />
<RootStack.Screen name="Details" component={DetailsScreen} />
</RootStack.Navigator>
</NavigationContainer>
);
}
React.memo for pure componentsuseMemo/useCallback for expensive computationsFlatList with getItemLayout for perfreact-native-fast-imageUse Turbo Modules (New Architecture) for bridging:
// NativeModule.ts
import { TurboModuleRegistry } from 'react-native';
export default TurboModuleRegistry.getEnforcing('MyCustomModule');
.ios.tsx/.android.tsx extensionsTake cosmicstack-labs/react-native-patterns from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.