Overview
This guide covers how to use@rnmapbox/maps with Expo. The library includes a config plugin that automates most of the native configuration.
Prerequisites
- Expo SDK 48 or higher
- Node.js (v22.16.0 recommended)
- Mapbox access token (see Setup Access Token)
- EAS CLI (for custom development builds)
Installation
Install the package
Install This ensures you get a version compatible with your Expo SDK.
@rnmapbox/maps using the Expo CLI:Configure location permissions (Optional)
If you want to show the user’s current location, install and configure the Then add it to your plugins array:
expo-location plugin:app.json
You can customize the
locationWhenInUsePermission message to better fit your app’s use case.Create a custom development build
Since this package requires custom native code, you need to create a custom development build:For more information, see Expo’s guide on adding custom native code.
- Local build
- EAS Build (Cloud)
Plugin Configuration Options
The@rnmapbox/maps config plugin accepts the following options:
RNMapboxMapsVersion
Override the native Mapbox SDK version:Usage Example
Once your custom build is ready, you can use Mapbox in your Expo app:App.js
Bare Workflow
If you’re using the bare workflow, you can follow the manual setup guides instead:Troubleshooting
”Expo Go” compatibility error
The library requires custom native code and cannot run in Expo Go. You must create a custom development build usingexpo prebuild or EAS Build.
Build fails after adding plugin
-
Clear your build cache:
-
Rebuild your app:
Changes to config plugin not taking effect
After modifying the config plugin settings:- Run
npx expo prebuild --cleanto regenerate native files - Rebuild your app
Next Steps
After completing the Expo setup:- Set up your Mapbox access token
- Explore the component documentation
- Check out the example applications
- Learn about UserLocation component for showing current location