@ohos-ports/react-native-navigation 8.9.0-beta.6 → 8.9.0-beta.8
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 +15 -4
- package/lib/cjs/components/Modal.js +3 -3
- package/package.json +1 -1
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
|
-
|
|
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
|
|
21
|
-
- **Dependency path replacement**: All `require('react-native')` → `require('@ohos-ports/react-native')
|
|
22
|
-
- **
|
|
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 = ((() => { try { return import_react_native.Dimensions.get("window") || { width: 375, height: 812 }; } catch(e) { return { width: 375, height: 812 }; } })()).width;
|
|
42
|
+
const windowHeight = ((() => { try { return import_react_native.Dimensions.get("window") || { width: 375, height: 812 }; } catch(e) { return { 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(((() => { try { return import_react_native.Dimensions.get("window") || { width: 375, height: 812 }; } catch(e) { return { width: 375, height: 812 }; } })()).height);
|
|
106
106
|
const SCREEN_ANIMATION_DURATION = 500;
|
|
107
107
|
const showModalSlideEnterAnimations = {
|
|
108
108
|
translationY: {
|
package/package.json
CHANGED