Skip to content

Commit dfe5bfb

Browse files
committed
fix: fix focuse aware statue bar crash in web
1 parent 5b7bc67 commit dfe5bfb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { useIsFocused } from '@react-navigation/native';
22
import { useColorScheme } from 'nativewind';
33
import * as React from 'react';
4+
import { Platform } from 'react-native';
45
import { SystemBars } from 'react-native-edge-to-edge';
56

67
type Props = { hidden?: boolean };
78
export const FocusAwareStatusBar = ({ hidden = false }: Props) => {
89
const isFocused = useIsFocused();
910
const { colorScheme } = useColorScheme();
1011

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

0 commit comments

Comments
 (0)