@ohos-ports/react-native-navigation
v8.9.0-beta.12
Published
React Native Navigation - truly native navigation for iOS and Android (HarmonyOS port)
Downloads
2,155
Keywords
Readme
@ohos-ports/react-native-navigation
React Native Navigation — truly native navigation for iOS and Android, ported for HarmonyOS.
Installation
npm install @ohos-ports/react-native-navigation @ohos-ports/react-native reactThe react-native overrides (mapping all react-native references to @ohos-ports/react-native) are automatically configured by the package's postinstall script. If the script does not run (e.g. install scripts are disabled), add this to your project's package.json manually:
{
"overrides": {
"react-native": "npm:@ohos-ports/react-native@^0.87.1-beta.2"
}
}This ensures that all react-native references (including transitive dependencies) resolve to @ohos-ports/react-native, preventing the original Facebook react-native (with Flow syntax) from being installed.
Requirements
- Node.js >= 22
@ohos-ports/react-nativeruntime
What was changed
- ESM → CJS transpilation: Source converted from ESM (
import/export) to CommonJS (require/module.exports) using esbuild. - Dependency path replacement: All
require('react-native')→require('@ohos-ports/react-native'). - Dimensions fallback:
Dimensions.get('window')returns default values (375×812) when RN bridge is not initialized. - lodash ESM fix:
.jsextensions added to lodash deep imports.
License
MIT
