refactor: use react-native-screens for web as well

This commit is contained in:
Satyajit Sahoo
2021-05-09 06:24:04 +02:00
parent 8da4c58065
commit 4294318210
4 changed files with 8 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import { Platform, StyleProp, ViewStyle } from 'react-native';
import type { StyleProp, ViewStyle } from 'react-native';
import { Screen, screensEnabled } from 'react-native-screens';
import { ResourceSavingView } from '@react-navigation/elements';
@@ -11,8 +11,7 @@ type Props = {
};
export default function ScreenFallback({ visible, children, ...rest }: Props) {
// react-native-screens is buggy on web
if (screensEnabled?.() && Platform.OS !== 'web') {
if (screensEnabled?.()) {
return (
<Screen activityState={visible ? 2 : 0} {...rest}>
{children}