[React Native] PickerIOS can update its items list

Summary:
@public
PickerIOS doesn't look at the content of its list. It just keeps a list ref
and pushes new items in.  Sadly this doesn't work with the naive reference checker
so new item lists don't trigger a native rerender.

The solution here is to ask PickerIOS to just pass its props down to native directly

Test Plan:
Implemented a simple Picker hooked up to a store getting new items.
Watched the list not update and then update after this diff as new items come in
This commit is contained in:
Alex Madjar 2015-06-03 17:47:24 -07:00
Родитель 7ffa7bd1f1
Коммит 015b5cf8e5
1 изменённых файлов: 2 добавлений и 11 удалений

Просмотреть файл

@ -20,8 +20,7 @@ var RCTPickerIOSConsts = require('NativeModules').UIManager.RCTPicker.Constants;
var StyleSheet = require('StyleSheet');
var View = require('View');
var createReactNativeComponentClass =
require('createReactNativeComponentClass');
var requireNativeComponent = require('requireNativeComponent');
var merge = require('merge');
var PICKER = 'picker';
@ -112,14 +111,6 @@ var styles = StyleSheet.create({
},
});
var rkPickerIOSAttributes = merge(ReactNativeViewAttributes.UIView, {
items: true,
selectedIndex: true,
});
var RCTPickerIOS = createReactNativeComponentClass({
validAttributes: rkPickerIOSAttributes,
uiViewClassName: 'RCTPicker',
});
var RCTPickerIOS = requireNativeComponent('RCTPicker', null);
module.exports = PickerIOS;