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';
12
12
13
13
import processColor from '../../StyleSheet/processColor' ;
14
14
import Platform from '../../Utilities/Platform' ;
15
+ import warnOnce from '../../Utilities/warnOnce' ;
15
16
import NativeStatusBarManagerAndroid from './NativeStatusBarManagerAndroid' ;
16
17
import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS' ;
17
18
import invariant from 'invariant' ;
@@ -393,6 +394,13 @@ class StatusBar extends React.Component<Props> {
393
394
_stackEntry = null ;
394
395
395
396
componentDidMount ( ) {
397
+ if ( Platform . isVisionOS ) {
398
+ warnOnce (
399
+ 'StatusBar-unavailable' ,
400
+ 'StatusBar is not available on visionOS platform.' ,
401
+ ) ;
402
+ return ;
403
+ }
396
404
// Every time a StatusBar component is mounted, we push it's prop to a stack
397
405
// and always update the native status bar with the props from the top of then
398
406
// 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
91
91
92
92
- (void )stopObserving
93
93
{
94
+ #if !TARGET_OS_VISION
94
95
[[NSNotificationCenter defaultCenter ] removeObserver: self ];
96
+ #endif
95
97
}
96
98
97
99
- (void )emitEvent : (NSString *)eventName forNotification : (NSNotification *)notification
You can’t perform that action at this time.
0 commit comments