Brings Uber's H3, the hexagonal hierarchical geospatial index, to native iOS and Android applications. It vendors the H3 C library and calls it directly from native code instead of running it through JavaScript.
The result is a native H3 binding designed for performance-sensitive React Native workloads.
- ⚡ Up to 862× faster than
h3-js. See the benchmark → - 🧬 H3 as compiled C++, called through Nitro Modules
- 🔢
bigintcell indexes, no hexadecimal strings - 📦 Typed-array results over the native buffer
- 🧵 Batch calls for whole coordinate and cell arrays
- ⏱️ Async variants on a background thread
- 🔁 The
h3-jsnames and a migration guide
📚 Read the documentation for the guides, the API reference and the migration from
h3-js.
Install from npm together with Nitro Modules:
bun add react-native-nitro-h3 react-native-nitro-modules
cd ios && pod installGetting started has the npm and Expo commands, the New Architecture note and the requirements.
import { latLngToCell, gridDisk, cellToString } from 'react-native-nitro-h3'
// H3 cell for San Francisco at resolution 9
const cell = latLngToCell(37.7749, -122.4194, 9)
console.log(cell) // 617700169957507071n
console.log(cellToString(cell)) // "89283082803ffff"
// The cell and its six neighbours, as one BigUint64Array
const neighbours = gridDisk(cell, 1)
console.log(neighbours.length) // 7Coming from h3-js? Read the migration guide: the h3-js names with unit suffixes instead of a unit argument, cells as bigint, cell sets as BigUint64Array.
- Documentation
- LLMs.txt: the docs for agents and assistants
- Showcase: five acts of one app
- Getting started: install, first call, requirements
- Migrating from h3-js
- API reference: every exported function
- Example app: the benchmark and harness app
- Contributing: build, test, add an operation
react-native-nitro-h3 is released under the MIT License. The vendored H3 C sources keep their Apache-2.0 LICENSE and NOTICE files.
