Skip to content

Commit

Permalink
fix: properly retrieve window when clicking DevMenu action (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski authored Feb 6, 2024
1 parent 9fbe761 commit 1055b58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react-native/React/CoreModules/RCTDevMenu.mm
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,15 @@ - (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__
{
return ^(__unused UIAlertAction *action) {
if (item) {
#if TARGET_OS_VISION
/// Execute this handler after the action sheet is dismissed to properly retrieve window when using SwiftUI entry point.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0), dispatch_get_main_queue(), ^{
[item callHandler];
});
#else
[item callHandler];
#endif
}

self->_actionSheet = nil;
};
}
Expand Down

0 comments on commit 1055b58

Please sign in to comment.