react-native-ui-lib 8.3.3 → 8.3.4
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/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import { useModifiers, useThemeProps } from "../../hooks";
|
|
|
2
2
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { View as RNView, SafeAreaView, Animated } from 'react-native';
|
|
4
4
|
import { Constants } from "../../commons/new";
|
|
5
|
+
import { SafeAreaContextPackage } from "../../optionalDependencies";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Extra props when using reanimated (only non experimental props)
|
|
@@ -65,7 +66,12 @@ function View(props, ref) {
|
|
|
65
66
|
}
|
|
66
67
|
}, []);
|
|
67
68
|
const ViewContainer = useMemo(() => {
|
|
68
|
-
|
|
69
|
+
let container = RNView;
|
|
70
|
+
if (useSafeArea && SafeAreaContextPackage?.SafeAreaView) {
|
|
71
|
+
container = SafeAreaContextPackage.SafeAreaView;
|
|
72
|
+
} else if (useSafeArea && Constants.isIOS) {
|
|
73
|
+
container = SafeAreaView;
|
|
74
|
+
}
|
|
69
75
|
if (reanimated) {
|
|
70
76
|
const {
|
|
71
77
|
default: Reanimated
|
|
@@ -89,11 +95,8 @@ function View(props, ref) {
|
|
|
89
95
|
if (!ready) {
|
|
90
96
|
return null;
|
|
91
97
|
}
|
|
92
|
-
return
|
|
93
|
-
//@ts-expect-error
|
|
94
|
-
<ViewContainer accessibilityElementsHidden={inaccessible} importantForAccessibility={inaccessible ? 'no-hide-descendants' : undefined} fsTagName={recorderTag} {...others} style={_style} ref={ref}>
|
|
98
|
+
return <ViewContainer accessibilityElementsHidden={inaccessible} importantForAccessibility={inaccessible ? 'no-hide-descendants' : undefined} fsTagName={recorderTag} {...others} style={_style} ref={ref}>
|
|
95
99
|
{children}
|
|
96
|
-
</ViewContainer
|
|
97
|
-
);
|
|
100
|
+
</ViewContainer>;
|
|
98
101
|
}
|
|
99
102
|
export default React.forwardRef(View);
|