Introduction
The @react-native-community/geolocation package has been the standard way to access device location in React Native apps.
With the React Native ecosystem moving toward TurboModules, Fabric, and JSI-based architecture, we saw an opportunity to bring geolocation to the new architecture while improving the developer experience.
This project — React Native Nitro Geolocation — is a native iOS/Android
module designed for the Nitro Module system. It is best positioned as a
React Native 0.75+ / New Architecture path for replacing the core native
@react-native-community/geolocation API with /compat, then gradually moving
to a typed Modern API.
When should I use this?
Web support is available for the Modern API root import. Browser builds resolve
the package root to a web entry that uses navigator.geolocation and does not
load Nitro native bindings. The /compat subpath remains native-only.
React Native Nitro Geolocation provides two APIs to fit your needs:
1. Modern API (Recommended)
Simple functional API with direct calls and minimal abstractions.
Key Features:
- 🎯 Simple and direct — No complex abstractions
- 🪝 Single hook for continuous tracking
- 🧹 Auto-cleanup when component unmounts
- 📘 Full TypeScript support
2. Compat API (Compatibility)
Drop-in compatible with the core native @react-native-community/geolocation
API via the /compat subpath.
Use cases:
- Drop-in replacement for existing apps
- Minimal migration effort
- Callback-based API preference
Why Modern API?
The Modern API brings simplicity and React hook patterns to geolocation:
Declarative vs Imperative
Before (Imperative):
After (Declarative):
Key Benefits
- 🎯 Simple and Direct: Just functions and one hook
- 🧹 Auto-cleanup: No need to remember
clearWatch()inuseEffectcleanup - 🪝 Single Hook: Only
useWatchPositionfor continuous tracking - 📘 Type-safe: Full TypeScript support with inference
- ⚡ High Performance: JSI-powered for native speed
Motivation
The motivation behind React Native Nitro Geolocation is twofold:
1. Update the Architecture
React Native has evolved with new architectural capabilities, and we wanted to bring these benefits to the Geolocation API.
@react-native-community/geolocation was built on the bridge-based architecture, which was the standard at the time. The new JSI-based architecture offers different characteristics:
- Direct communication between JS and native layers
- Support for synchronous APIs when needed
- Better integration with concurrent React and Fabric
- Enhanced TypeScript support and platform consistency
2. Improve Developer Experience
We created a geolocation API that:
- Simple configuration: Call
setConfiguration()once - Direct function calls: No classes or complex abstractions
- Handles lifecycle automatically: No manual cleanup required
- Provides declarative control:
{ enabled }prop instead of start/stop - Ensures type safety: Full TypeScript inference
Design Philosophy
Simple and Functional
Instead of complex provider patterns or class-based APIs, we provide:
Core Principles
- Configuration at startup: Set up once with
setConfiguration() - Direct function calls: Use Promise-based functions directly
- Single hook for tracking:
useWatchPositionhandles continuous updates - Automatic lifecycle: No manual cleanup code
- Type-safe by default: Full TypeScript inference
- Performance first: JSI-powered for native speed
What You Get
Whether you choose Modern or Compat API, you get:
- 🚀 Lower cached-read overhead through direct JSI bindings
- 📱 Improved native consistency across Android and iOS
- 🔁 Seamless migration from
@react-native-community/geolocation - 🧩 TypeScript-first developer experience
- 🔄 Compat API (via
/compat) for the core native community geolocation surface
The benchmark measures cached location reads and the JS-to-native call path. It does not make cold GPS acquisition itself 22x faster.
Whether you're upgrading an existing app or building a new one using the latest React Native architecture, React Native Nitro Geolocation gives you the Modern API with a migration-friendly compat path.
Next Steps
- Quick Start Guide — Get up and running in minutes
- Migration Skills — Choose the right agent skill for community or service migrations
- Community Migration — Move from community imports to
/compatand the Modern API - Service Migration — Move from
react-native-geolocation-servicedirectly to the Modern API - Expo Development Build Guide — Use the package in Expo custom native builds
- Modern API Reference — Explore functions and hooks
- Compat API Reference — Compatibility documentation
- Why Nitro Module? — Architecture deep dive
- Benchmark Results — Performance comparison
