Skip to content

Commit

Permalink
Move ActionSheet UI operation to main thread (#41666)
Browse files Browse the repository at this point in the history
Summary:
Fixes UI operation not on the main thread.
![image](https://github.com/facebook/react-native/assets/5061845/276f7e9c-dcf8-4ba1-af2d-c9fa990d41a1)

![image](https://github.com/facebook/react-native/assets/5061845/cfe85921-3cc9-4f32-b794-a6a8bc00ee1d)

## Changelog:

[IOS] [FIXED] - Move ActionSheet UI operation to main thread

Pull Request resolved: #41666

Test Plan: None.

Reviewed By: philIip

Differential Revision: D51613525

Pulled By: cipolleschi

fbshipit-source-id: e5f543bbcc9bc0f5b6dda5bc2deb20279e851946
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Nov 28, 2023
1 parent 129bd9d commit aa9e824
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ - (void)presentViewController:(UIViewController *)alertController
[RCTConvert UIColor:options.cancelButtonTintColor() ? @(*options.cancelButtonTintColor()) : nil];
NSString *userInterfaceStyle = [RCTConvert NSString:options.userInterfaceStyle()];

UIViewController *controller = RCTPresentedViewController();

dispatch_async(dispatch_get_main_queue(), ^{
UIViewController *controller = RCTPresentedViewController();

if (controller == nil) {
RCTLogError(
@"Tried to display action sheet but there is no application window. options: %@", @{
Expand Down

0 comments on commit aa9e824

Please sign in to comment.