diff --git a/packages/react-native/React/CoreModules/RCTAlertManager.mm b/packages/react-native/React/CoreModules/RCTAlertManager.mm index 674bc389a94086..415bb1f6fb838d 100644 --- a/packages/react-native/React/CoreModules/RCTAlertManager.mm +++ b/packages/react-native/React/CoreModules/RCTAlertManager.mm @@ -84,6 +84,7 @@ - (void)invalidate NSString *destructiveButtonKey = [RCTConvert NSString:args.destructiveButtonKey()]; NSString *preferredButtonKey = [RCTConvert NSString:args.preferredButtonKey()]; UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()]; + UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()]; if (!title && !message) { RCTLogError(@"Must specify either an alert title, or message, or both"); @@ -108,7 +109,6 @@ - (void)invalidate message:nil preferredStyle:UIAlertControllerStyleAlert]; - UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()]; alertController.overrideUserInterfaceStyle = userInterfaceStyle; switch (type) {