Overview
This guide helps you migrate between major versions of@rnmapbox/maps. Each section covers breaking changes and required updates for specific version upgrades.
Migrating to v11 (Current)
The library now exclusively supports Mapbox Maps SDK v11 and React Native’s New Architecture (Fabric/TurboModules).Prerequisites
- React Native 0.79 or higher
- New Architecture enabled (Fabric/TurboModules)
- Node.js v22.16.0 or higher
Breaking Changes
React Native version requirement
Update to React Native 0.79 or higher, which includes the New Architecture by default.
Mapbox SDK v11
The library now uses Mapbox Maps SDK v11. Review the Mapbox v11 migration guide for platform-specific changes.Key updates:
- New style configuration API
- Slot-based layer positioning
- Model layers support
- Updated terrain and 3D features
LocationPuck replaces UserLocation renderMode
The After (v11):
UserLocation component’s renderMode prop is deprecated. Use the new LocationPuck component for native user location rendering:Before (v10):Migrating to v10 from v8/v9
Package Name Change
The package name changed from@react-native-mapbox-gl/maps to @rnmapbox/maps.
Update imports
Update all imports in your code:Before:After:
You can use tools like babel-plugin-transform-rename-import to maintain old imports during migration.
Setup Changes
- iOS
- Android
Update your After:
Podfile hooks:Before:MapLibre Support
Version 10 introduced MapLibre as an option. To use MapLibre: iOS:Migrating to v8 from v7
StyleSheet Changes
StyleSheet.create and StyleSheet.identity were removed in favor of expressions:
Before (v7):
Camera Component
Camera-related properties moved fromMapView to the Camera component:
Before (v7):
User Tracking Mode
MapView#userTrackingMode→Camera#followUserModeandCamera#followUserLocationfollowUserModeuses strings:'normal','compass','course'UserTrackingModesenum is deprecated
ShapeSource Images
ShapeSource#images was deprecated. Use the Images component:
Before (v7):
Event Payload Changes
VectorSource and SymbolSource onPress events changed:
Before (v7):
Removed APIs
isTelemetryEnabledremoved (Android compatibility)geoUtilsmade private - use Turf.js insteadMapView#flyTo,MapView#fitBounds,MapView#moveTo,MapView#zoomTomoved toCamera
General Migration Tips
Review release notes
Check the GitHub releases page for detailed release notes and additional changes.
Test thoroughly
Test all map-related features in your app:
- Map rendering and styles
- User location and tracking
- Annotations and markers
- Camera movements
- Custom sources and layers
Getting Help
If you encounter issues during migration:- Check GitHub Discussions
- Join the Mapbox Discord #react-native channel
- Review closed issues on GitHub
- Consult the example app for updated usage patterns