react-native-mock icon indicating copy to clipboard operation
react-native-mock copied to clipboard

The item of the PickerIOS

Open lulutia opened this issue 8 years ago • 4 comments

fix the warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).

lulutia avatar Jun 03 '16 09:06 lulutia

Nice. Can you implement it in the same way TabBarIOS is though, to keep the implementation the same as the rest of the library.

RealOrangeOne avatar Jun 03 '16 09:06 RealOrangeOne

I tested the implementation now you use in the TabBarIOS, it throws the warnings as well, but not for the TabBarIOS.Item, but for the TabBarIOS itself. I changed it as follows, then it will be fine

const ReactNative = {
...
Picker: createMockComponent('Picker'),
TabBarIOS: createMockComponent('TabBarIOS'),
...
}
ReactNative.PickerIOS.Item = createMockComponent('PickerIOS.Item');
ReactNative.TabBarIOS.Item = createMockComponent('TabBarIOS.Item');

lulutia avatar Jun 04 '16 18:06 lulutia

hmm, weird it doesnt like that, but i'm still not entirely happy with this implementation. Could you maybe add the 'Item' component as a static attribute of the PickerIOS?

RealOrangeOne avatar Jun 04 '16 21:06 RealOrangeOne

It's indeed a static attribute. I dot' understand your destruction declare, only copy the attributes without the constructor self.

feyy avatar Jun 06 '16 04:06 feyy