File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Libraries/Components/StatusBar Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheet';
1212
1313import processColor from '../../StyleSheet/processColor' ;
1414import Platform from '../../Utilities/Platform' ;
15+ import warnOnce from '../../Utilities/warnOnce' ;
1516import NativeStatusBarManagerAndroid from './NativeStatusBarManagerAndroid' ;
1617import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS' ;
1718import invariant from 'invariant' ;
@@ -393,6 +394,13 @@ class StatusBar extends React.Component<Props> {
393394 _stackEntry = null ;
394395
395396 componentDidMount ( ) {
397+ if ( Platform . isVisionOS ) {
398+ warnOnce (
399+ 'StatusBar-unavailable' ,
400+ 'StatusBar is not available on visionOS platform.' ,
401+ ) ;
402+ return ;
403+ }
396404 // Every time a StatusBar component is mounted, we push it's prop to a stack
397405 // and always update the native status bar with the props from the top of then
398406 // stack. This allows having multiple StatusBar components and the one that is
Original file line number Diff line number Diff line change @@ -91,7 +91,9 @@ - (void)startObserving
9191
9292- (void )stopObserving
9393{
94+ #if !TARGET_OS_VISION
9495 [[NSNotificationCenter defaultCenter ] removeObserver: self ];
96+ #endif
9597}
9698
9799- (void )emitEvent : (NSString *)eventName forNotification : (NSNotification *)notification
You can’t perform that action at this time.
0 commit comments