[X] I checked for possible duplicate issues, with possible answers.
Bug summary
Just found an error in Xcode saying a UI method is called on a background thread. This was killing my debugger. I looked into it and found it was the following code:
// in file RNBootSplash.m
- (NSDictionary *)constantsToExport {
UIWindow *window = RCTKeyWindow(); // This is a UI method and is being called on the background thread
__block bool darkModeEnabled = false;
RCTUnsafeExecuteOnMainQueueSync(^{
// It should be moved in here <---------------
darkModeEnabled = window != nil && window.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark;
});
Moving inside the RCTUnsafeExecuteOnMainQueueSync block fixes the error and it makes sense it should be in there as it is a UI method. Let me know your thoughts. Thanks.
Before submitting a new issue
Bug summary
Just found an error in Xcode saying a UI method is called on a background thread. This was killing my debugger. I looked into it and found it was the following code:
Moving inside the RCTUnsafeExecuteOnMainQueueSync block fixes the error and it makes sense it should be in there as it is a UI method. Let me know your thoughts. Thanks.
Library version
5.5.3
Environment info
Steps to reproduce
Reproducible sample code