Skip to content

Commit 1055b58

Browse files
authored
fix: properly retrieve window when clicking DevMenu action (#95)
1 parent 9fbe761 commit 1055b58

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/react-native/React/CoreModules/RCTDevMenu.mm

+7-1
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,15 @@ - (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__
409409
{
410410
return ^(__unused UIAlertAction *action) {
411411
if (item) {
412+
#if TARGET_OS_VISION
413+
/// Execute this handler after the action sheet is dismissed to properly retrieve window when using SwiftUI entry point.
414+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0), dispatch_get_main_queue(), ^{
415+
[item callHandler];
416+
});
417+
#else
412418
[item callHandler];
419+
#endif
413420
}
414-
415421
self->_actionSheet = nil;
416422
};
417423
}

0 commit comments

Comments
 (0)