Skip to content

Commit 0467265

Browse files
hamzamekkasdolo
authored andcommitted
fix: fix focuse aware statue bar crash in web
1 parent 9fd05d6 commit 0467265

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { useIsFocused } from '@react-navigation/native';
22
import { useColorScheme } from 'nativewind';
3+
import * as React from 'react';
4+
import { Platform } from 'react-native';
35
import { SystemBars } from 'react-native-edge-to-edge';
46

57
type Props = { hidden?: boolean };
68
export const FocusAwareStatusBar = ({ hidden = false }: Props) => {
79
const isFocused = useIsFocused();
810
const { colorScheme } = useColorScheme();
911

12+
if (Platform.OS === 'web') {
13+
return null;
14+
}
15+
1016
return isFocused ? <SystemBars style={colorScheme} hidden={hidden} /> : null;
1117
};

0 commit comments

Comments
 (0)