From ad0c97f25b64914256b2791b17dd19c8f9886f31 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Tue, 8 Sep 2015 03:27:44 -0700 Subject: [PATCH] Fixed PickerIOS onChange event --- Libraries/Picker/PickerIOS.ios.js | 8 +++++++- React/Views/RCTPickerManager.m | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Libraries/Picker/PickerIOS.ios.js b/Libraries/Picker/PickerIOS.ios.js index 42302fa26..1a965b32f 100644 --- a/Libraries/Picker/PickerIOS.ios.js +++ b/Libraries/Picker/PickerIOS.ios.js @@ -111,6 +111,12 @@ var styles = StyleSheet.create({ }, }); -var RCTPickerIOS = requireNativeComponent('RCTPicker', null); +var RCTPickerIOS = requireNativeComponent('RCTPicker', PickerIOS, { + nativeOnly: { + items: true, + onChange: true, + selectedIndex: true, + }, +}); module.exports = PickerIOS; diff --git a/React/Views/RCTPickerManager.m b/React/Views/RCTPickerManager.m index 8d1e18120..d43c58ad9 100644 --- a/React/Views/RCTPickerManager.m +++ b/React/Views/RCTPickerManager.m @@ -24,6 +24,7 @@ RCT_EXPORT_MODULE() RCT_EXPORT_VIEW_PROPERTY(items, NSDictionaryArray) RCT_EXPORT_VIEW_PROPERTY(selectedIndex, NSInteger) +RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock) - (NSDictionary *)constantsToExport {