ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.24k stars 429 forks source link

Fix #85 - callback associated with button in Alert.alert not working #134

Closed matpaul closed 7 years ago

matpaul commented 7 years ago

Hi, i try to fix alerts callback and it's work now, but i don't understand some variables in RCTAlertManager.m:

NSMutableArray<NSAlert *> *_alerts;
NSMutableArray<RCTResponseSenderBlock> *_alertCallbacks;
NSMutableArray<NSArray<NSString *> *> *_alertButtonKeys;

So if you can explain for what it, i'll complete it =)

Thanks

ptmt commented 7 years ago

Thanks for fix. This comes straight from React Native, I barely touched it. Alerts in RN can have multiple buttons (like OK, Cancel or Try Again, Ignore), thus each button should have callback. See https://facebook.github.io/react-native/docs/alert.html

matpaul commented 7 years ago

@ptmt Should i clear code from unused variables ? How to fix travis checks ?

ptmt commented 7 years ago

Don't worry, Travis is on me, it needs update from upstream.