react-native-maps-skill
Installation
SKILL.md
React Native Maps — Best Practices & Complete Guide
react-native-maps 1.26.20+ / Expo SDK 54/55 / React Native 0.81.1+ / New Architecture Compatible
Critical Rules
- Always use
npx expo install react-native-maps— ensures version compatibility with your Expo SDK. - Never commit API keys — use environment variables via
app.config.jswithprocess.env. - Always restrict API keys — Android: package name + SHA-1; iOS: bundle identifier; API: Maps SDK only.
- Always run
npx expo prebuild --cleanafter changing map config in app.json/app.config.js. - Use
initialRegionnotregionunless you need controlled map positioning —regioncauses re-renders on every pan. - Memoize marker arrays with
useMemo— recreating marker elements every render causes lag. - Use
React.memofor custom marker components — prevents unnecessary re-renders of all markers. - Use clustering for 50+ markers — install
react-native-map-clusteringto avoid frame drops. - Handle the
nullmap ref — always checkmapRef.currentbefore calling methods likeanimateToRegion. - Request location permissions before enabling
showsUserLocation— otherwise the map silently fails on iOS.
Version Compatibility
Related skills