44 lines
1.9 KiB
Diff
44 lines
1.9 KiB
Diff
diff --git a/src/native_components/RNIDetachedView/RNIDetachedView.tsx b/src/native_components/RNIDetachedView/RNIDetachedView.tsx
|
|
index 5f7eb500892fbcef4a799a26a2c02c01e7abcf49..e029167f980b83f471040af62e1f3f0c4500c338 100644
|
|
--- a/src/native_components/RNIDetachedView/RNIDetachedView.tsx
|
|
+++ b/src/native_components/RNIDetachedView/RNIDetachedView.tsx
|
|
@@ -68,6 +68,10 @@ export const RNIDetachedView = React.forwardRef<
|
|
const reactChildrenCount = React.Children.count(props.children);
|
|
|
|
const children = React.Children.map(props.children, (child) => {
|
|
+ // child is React.Fragment
|
|
+ if (React.isValidElement(child) && child.type === React.Fragment) {
|
|
+ return child;
|
|
+ }
|
|
return React.cloneElement(
|
|
child as React.ReactElement<RNIDetachedViewContentProps>,
|
|
{
|
|
diff --git a/src/native_components/RNIDetachedView/RNIDetachedViewContent.tsx b/src/native_components/RNIDetachedView/RNIDetachedViewContent.tsx
|
|
index 37db0454c3430fc1eed0c9fc1d82660613b47353..6abf37083b34f69b4db9ebf04c3e82b1fca84d4d 100644
|
|
--- a/src/native_components/RNIDetachedView/RNIDetachedViewContent.tsx
|
|
+++ b/src/native_components/RNIDetachedView/RNIDetachedViewContent.tsx
|
|
@@ -14,7 +14,7 @@ export function RNIDetachedViewContent(
|
|
props: React.PropsWithChildren<RNIDetachedViewContentProps>
|
|
) {
|
|
const [viewID, setViewID] = React.useState<StateViewID>();
|
|
-
|
|
+ const { isParentDetached, ...rest } = props
|
|
const wrapperStyle: StyleProp<ViewStyle> = [
|
|
props.shouldEnableDebugBackgroundColors && styles.wrapperViewDebug,
|
|
props.contentContainerStyle,
|
|
@@ -25,12 +25,12 @@ export function RNIDetachedViewContent(
|
|
?? DEFAULT_DETACHED_SUBVIEW_ENTRY;
|
|
|
|
const didDetach =
|
|
- (props.isParentDetached ?? false)
|
|
+ (isParentDetached ?? false)
|
|
|| detachedSubviewEntry.didDetachFromOriginalParent;
|
|
|
|
return (
|
|
<RNIWrapperView
|
|
- {...props}
|
|
+ {...rest}
|
|
style={[
|
|
...(IS_USING_NEW_ARCH
|
|
? wrapperStyle
|