File tree Expand file tree Collapse file tree
Libraries/Components/StatusBar Expand file tree Collapse file tree 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 @@ -94,7 +94,9 @@ - (void)startObserving
9494
9595- (void )stopObserving
9696{
97+ #if !TARGET_OS_VISION
9798 [[NSNotificationCenter defaultCenter ] removeObserver: self ];
99+ #endif
98100}
99101
100102- (void )emitEvent : (NSString *)eventName forNotification : (NSNotification *)notification
You can’t perform that action at this time.
0 commit comments