I'm writing components for our react-native project
I get this error from prop-types
"Warning: Failed prop type: Invalid prop containerStyle
of type number
supplied to ImagePicker
, expected object
."
Simplified example:
common-styles.js
export const defaultStyle = StyleSheet.create({
container: {
color: 'red',
borderWidth: 2
}
});
image-picker.js
ImagePicker.propTypes = {
containerStyle: PropTypes.shape(),
};
app.js
<ImagePicker containerStyle={styles.defaultStyle} />
What is the PropType for passing Stylesheet variables?
Thank you
styles
(ofcontainerStyle={styles.defaultStyle}
) being defined? – acdcjunior<ImagePicker containerStyle={[form_input.pads, { borderWidth: 1 }]} />
, I'll be checking this again and see if I can workaround the array issue – mjabadilla