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 complete reimplementation designed for the Nitro Module system, providing two APIs to fit your needs:
Simple functional API with direct calls and minimal abstractions.
Key Features:
100% compatible with @react-native-community/geolocation via /compat subpath.
Use cases:
Drop-in replacement for existing apps
Minimal migration effort
Callback-based API preference
The Modern API brings simplicity and modern React patterns to geolocation:
Before (Imperative):
After (Declarative):
๐ฏ Simple and Direct: Just functions and one hook
๐งน Auto-cleanup: No need to remember clearWatch() in useEffect cleanup
๐ช Single Hook: Only useWatchPosition for continuous tracking
๐ Type-safe: Full TypeScript support with inference
โก High Performance: JSI-powered for native speed
The motivation behind React Native Nitro Geolocation is twofold:
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:
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
Instead of complex provider patterns or class-based APIs, we provide:
| Concept | Modern API |
|---|---|
| Configuration | setConfiguration() |
| Permission | checkPermission(), requestPermission() |
| Location | getCurrentPosition(), useWatchPosition() |
| Cleanup | Automatic (in hook) |
Configuration at startup: Set up once with setConfiguration()
Direct function calls: Use Promise-based functions directly
Single hook for tracking: useWatchPosition handles continuous updates
Automatic lifecycle: No manual cleanup code
Type-safe by default: Full TypeScript inference
Performance first: JSI-powered for native speed
Whether you choose Modern or Legacy API, you get:
@react-native-community/geolocation/compat) โ can be used as a drop-in replacementWhether you're upgrading an existing app or building a new one using the latest React Native architecture, React Native Nitro Geolocation gives you modern tools with proven performance.