Skip to content

Commit a4feefc

Browse files
committed
fix: fix duplicate renders
1 parent 75e277f commit a4feefc

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ React.useEffect(() => {
119119
}, [navigation]);
120120
```
121121

122+
Only supported on iOS.
123+
122124
### Helpers
123125

124126
The modal navigator adds the following methods to the navigation prop:

src/ModalView.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ export default function ModalView({ state, navigation, descriptors }: Props) {
3232
} = descriptor.options;
3333

3434
const element = (
35-
<View
36-
style={StyleSheet.absoluteFill}
37-
accessibilityElementsHidden={!focused}
38-
importantForAccessibility={
39-
focused ? 'auto' : 'no-hide-descendants'
40-
}
41-
>
42-
{descriptor.render()}
35+
<>
36+
<View
37+
style={StyleSheet.absoluteFill}
38+
accessibilityElementsHidden={!focused}
39+
importantForAccessibility={
40+
focused ? 'auto' : 'no-hide-descendants'
41+
}
42+
>
43+
{descriptor.render()}
44+
</View>
4345
{acc}
44-
</View>
46+
</>
4547
);
4648

4749
if (index === 0) {
@@ -82,7 +84,6 @@ export default function ModalView({ state, navigation, descriptors }: Props) {
8284
visible
8385
>
8486
{element}
85-
{acc}
8687
</Modal>
8788
);
8889
}, <></>)}

0 commit comments

Comments
 (0)