react-native-mock
react-native-mock copied to clipboard
The item of the PickerIOS
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).
Nice. Can you implement it in the same way TabBarIOS
is though, to keep the implementation the same as the rest of the library.
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');
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
?
It's indeed a static attribute. I dot' understand your destruction declare, only copy the attributes without the constructor self.