@ohos-ports/react-native-navigation 8.9.0-beta.5 → 8.9.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,17 @@ React Native Navigation — truly native navigation for iOS and Android, ported
8
8
  npm install @ohos-ports/react-native-navigation @ohos-ports/react-native react
9
9
  ```
10
10
 
11
- That's it. No npm alias, no postinstall, no extra configuration.
11
+ And add this to your project's `package.json`:
12
+
13
+ ```json
14
+ {
15
+ "overrides": {
16
+ "react-native": "npm:@ohos-ports/react-native@^0.87.1-beta.1"
17
+ }
18
+ }
19
+ ```
20
+
21
+ The `overrides` field ensures that all `react-native` references (including transitive peer dependencies) resolve to `@ohos-ports/react-native`, preventing the original facebook `react-native` (with Flow syntax) from being installed.
12
22
 
13
23
  ## Requirements
14
24
 
@@ -17,9 +27,10 @@ That's it. No npm alias, no postinstall, no extra configuration.
17
27
 
18
28
  ## What was changed
19
29
 
20
- - **ESM → CJS transpilation**: Source files converted from ESM (`import`/`export`) to CommonJS (`require`/`module.exports`) using esbuild, eliminating ESM/CJS interop issues.
21
- - **Dependency path replacement**: All `require('react-native')` → `require('@ohos-ports/react-native')`, `require('remx')` → `require('@ohos-ports/remx')`.
22
- - **lodash ESM fix**: Added `.js` extensions to lodash deep imports (done before transpilation).
30
+ - **ESM → CJS transpilation**: Source converted from ESM (`import`/`export`) to CommonJS (`require`/`module.exports`) using esbuild.
31
+ - **Dependency path replacement**: All `require('react-native')` → `require('@ohos-ports/react-native')`.
32
+ - **Dimensions fallback**: `Dimensions.get('window')` returns default values (375×812) when RN bridge is not initialized.
33
+ - **lodash ESM fix**: `.js` extensions added to lodash deep imports.
23
34
 
24
35
  ## License
25
36
 
@@ -38,8 +38,8 @@ const RNNModalViewManager = (0, import_react_native.requireNativeComponent)("RNN
38
38
  const Container = (rnnProps) => {
39
39
  const viewRef = (0, import_react.useRef)(null);
40
40
  (0, import_react.useLayoutEffect)(() => {
41
- const windowWidth = import_react_native.Dimensions.get("window").width;
42
- const windowHeight = import_react_native.Dimensions.get("window").height;
41
+ const windowWidth = (import_react_native.Dimensions.get("window")||{width:375,height:812}).width;
42
+ const windowHeight = (import_react_native.Dimensions.get("window")||{width:375,height:812}).height;
43
43
  viewRef?.current?.setNativeProps({
44
44
  width: windowWidth,
45
45
  height: windowHeight
@@ -102,7 +102,7 @@ class Modal extends import_react.default.Component {
102
102
  return processed;
103
103
  }
104
104
  }
105
- const height = Math.round(import_react_native.Dimensions.get("window").height);
105
+ const height = Math.round((import_react_native.Dimensions.get("window")||{width:375,height:812}).height);
106
106
  const SCREEN_ANIMATION_DURATION = 500;
107
107
  const showModalSlideEnterAnimations = {
108
108
  translationY: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohos-ports/react-native-navigation",
3
- "version": "8.9.0-beta.5",
3
+ "version": "8.9.0-beta.7",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android (HarmonyOS port)",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -47,6 +47,7 @@
47
47
  "lodash": "4.18.1",
48
48
  "prop-types": "15.x.x",
49
49
  "react-lifecycles-compat": "^3.0.4",
50
- "tslib": "1.9.3"
50
+ "tslib": "1.9.3",
51
+ "react-native": "npm:@ohos-ports/react-native@^0.87.1-beta.1"
51
52
  }
52
53
  }