diff --git a/package.json b/package.json index 8a031226da..5a3616f398 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-elements", - "version": "1.2.1", + "version": "1.2.2", "description": "React Native Elements & UI Toolkit", "main": "src/index.js", "types": "src/index.d.ts", @@ -43,6 +43,7 @@ }, "devDependencies": { "@react-native-community/eslint-config": "^0.0.5", + "@types/prop-types": "^15.7.3", "@types/react": "^16.4.16", "@types/react-native": "^0.57.4", "babel-jest": "^24.8.0", diff --git a/src/avatar/Avatar.js b/src/avatar/Avatar.js index 2cf8f95617..e5e0b713d8 100644 --- a/src/avatar/Avatar.js +++ b/src/avatar/Avatar.js @@ -227,7 +227,7 @@ Avatar.propTypes = { placeholderStyle: ViewPropTypes.style, renderPlaceholderContent: nodeType, imageProps: PropTypes.object, - ImageComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + ImageComponent: PropTypes.elementType, }; Avatar.defaultProps = { diff --git a/src/badge/Badge.js b/src/badge/Badge.js index 001b33d517..efc4acf953 100644 --- a/src/badge/Badge.js +++ b/src/badge/Badge.js @@ -45,7 +45,7 @@ Badge.propTypes = { textStyle: Text.propTypes.style, value: PropTypes.node, onPress: PropTypes.func, - Component: PropTypes.func, + Component: PropTypes.elementType, theme: PropTypes.object, status: PropTypes.oneOf(['primary', 'success', 'warning', 'error']), }; diff --git a/src/buttons/Button.js b/src/buttons/Button.js index 1e395f94c2..bcc830531a 100644 --- a/src/buttons/Button.js +++ b/src/buttons/Button.js @@ -167,8 +167,8 @@ Button.propTypes = { iconContainerStyle: ViewPropTypes.style, iconRight: PropTypes.bool, linearGradientProps: PropTypes.object, - TouchableComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), - ViewComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + TouchableComponent: PropTypes.elementType, + ViewComponent: PropTypes.elementType, disabled: PropTypes.bool, disabledStyle: ViewPropTypes.style, disabledTitleStyle: Text.propTypes.style, diff --git a/src/buttons/ButtonGroup.js b/src/buttons/ButtonGroup.js index e10168d186..1a1fe62b8e 100644 --- a/src/buttons/ButtonGroup.js +++ b/src/buttons/ButtonGroup.js @@ -208,7 +208,7 @@ const styles = { ButtonGroup.propTypes = { button: PropTypes.object, - Component: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + Component: PropTypes.elementType, onPress: PropTypes.func, buttons: PropTypes.array, containerStyle: ViewPropTypes.style, diff --git a/src/checkbox/CheckBox.js b/src/checkbox/CheckBox.js index 4cd03f7c50..9fb4874944 100644 --- a/src/checkbox/CheckBox.js +++ b/src/checkbox/CheckBox.js @@ -79,7 +79,7 @@ const CheckBox = props => { }; CheckBox.propTypes = { ...CheckBoxIcon.propTypes, - Component: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), + Component: PropTypes.elementType, iconRight: PropTypes.bool, title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]), titleProps: PropTypes.object, diff --git a/src/header/Header.js b/src/header/Header.js index 33d71d6640..00d53a409a 100644 --- a/src/header/Header.js +++ b/src/header/Header.js @@ -158,7 +158,7 @@ Header.propTypes = { ]), theme: PropTypes.object, linearGradientProps: PropTypes.object, - ViewComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + ViewComponent: PropTypes.elementType, }; Header.defaultProps = { diff --git a/src/icons/Icon.js b/src/icons/Icon.js index 5049374bee..a7fe03838d 100644 --- a/src/icons/Icon.js +++ b/src/icons/Icon.js @@ -83,7 +83,7 @@ Icon.propTypes = { name: PropTypes.string, size: PropTypes.number, color: PropTypes.string, - Component: PropTypes.func, + Component: PropTypes.elementType, underlayColor: PropTypes.string, reverse: PropTypes.bool, raised: PropTypes.bool, diff --git a/src/image/Image.js b/src/image/Image.js index 8c8613a3fe..e71ac7d863 100644 --- a/src/image/Image.js +++ b/src/image/Image.js @@ -108,7 +108,7 @@ const styles = { Image.propTypes = { ...ImageNative.propTypes, - ImageComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + ImageComponent: PropTypes.elementType, PlaceholderContent: nodeType, containerStyle: ViewPropTypes.style, placeholderStyle: ImageNative.propTypes.style, diff --git a/src/list/ListItem.js b/src/list/ListItem.js index 43416f3084..483ca65fc0 100644 --- a/src/list/ListItem.js +++ b/src/list/ListItem.js @@ -305,7 +305,7 @@ ListItem.propTypes = { containerStyle: ViewPropTypes.style, contentContainerStyle: ViewPropTypes.style, rightContentContainerStyle: ViewPropTypes.style, - Component: PropTypes.func, + Component: PropTypes.elementType, onPress: PropTypes.func, onLongPress: PropTypes.func, title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]), @@ -339,7 +339,7 @@ ListItem.propTypes = { bottomDivider: PropTypes.bool, pad: PropTypes.number, linearGradientProps: PropTypes.object, - ViewComponent: PropTypes.func, + ViewComponent: PropTypes.elementType, theme: PropTypes.object, }; @@ -366,7 +366,7 @@ const PadView = ({ children, pad, Component, ...props }) => { PadView.propTypes = { children: PropTypes.node, pad: PropTypes.number, - Component: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + Component: PropTypes.elementType, }; export { ListItem }; diff --git a/src/social/SocialIcon.js b/src/social/SocialIcon.js index 928b32560f..0f392ff3f0 100644 --- a/src/social/SocialIcon.js +++ b/src/social/SocialIcon.js @@ -136,7 +136,7 @@ const SocialIcon = props => { }; SocialIcon.propTypes = { - Component: PropTypes.func, + Component: PropTypes.elementType, type: PropTypes.string, button: PropTypes.bool, onPress: PropTypes.func, diff --git a/src/tile/FeaturedTile.js b/src/tile/FeaturedTile.js index ebb7bd126a..db54e1fb7a 100644 --- a/src/tile/FeaturedTile.js +++ b/src/tile/FeaturedTile.js @@ -141,7 +141,7 @@ FeaturedTile.propTypes = { captionStyle: NativeText.propTypes.style, width: PropTypes.number, height: PropTypes.number, - ImageComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + ImageComponent: PropTypes.elementType, imageProps: PropTypes.object, }; diff --git a/src/tile/Tile.js b/src/tile/Tile.js index 8ac13a53e9..2bb5585009 100644 --- a/src/tile/Tile.js +++ b/src/tile/Tile.js @@ -138,7 +138,7 @@ Tile.propTypes = { contentContainerStyle: ViewPropTypes.style, titleNumberOfLines: PropTypes.number, imageProps: PropTypes.object, - ImageComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + ImageComponent: PropTypes.elementType, }; Tile.defaultProps = { diff --git a/yarn.lock b/yarn.lock index 4bbd01f290..6dc66db4c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1078,6 +1078,11 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.6.tgz#9c03d3fed70a8d517c191b7734da2879b50ca26c" integrity sha512-ZBFR7TROLVzCkswA3Fmqq+IIJt62/T7aY/Dmz+QkU7CaW2QFqAitCE8Ups7IzmGhcN1YWMBT4Qcoc07jU9hOJQ== +"@types/prop-types@^15.7.3": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + "@types/react-native-vector-icons@^6.4.1": version "6.4.1" resolved "https://registry.yarnpkg.com/@types/react-native-vector-icons/-/react-native-vector-icons-6.4.1.tgz#d0862f3eb97bbe5720ab604f2f10ee07dacb31ef"