Skip to content

Commit af062a7

Browse files
authored
Merge pull request #28 from piuccio/master
Remove deprecated proptypes
2 parents 2632555 + 06e356f commit af062a7

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ renderCheckBox(data) {
8686

8787
Props | Type | Optional | Default | Description
8888
----------------- | -------- | -------- | ----------- | -----------
89-
style | View.propTypes.style | true | | Custom style checkbox
90-
leftText | React.PropTypes.string |true | | Custom left Text
89+
style | ViewPropTypes.style | true | | Custom style checkbox
90+
leftText | PropTypes.string |true | | Custom left Text
9191
leftTextStyle | Text.propTypes.style | true | | Custom left Text style
92-
rightText | React.PropTypes.string |true | | Custom right Text
93-
rightTextView | React.PropTypes.element | true | | Custom right TextView
92+
rightText | PropTypes.string |true | | Custom right Text
93+
rightTextView | PropTypes.element | true | | Custom right TextView
9494
rightTextStyle | Text.propTypes.style | true | | Custom right Text style
95-
checkedImage | React.PropTypes.element | true | Default image | Custom checked Image
96-
unCheckedImage | React.PropTypes.element | true | Default image | Custom unchecked Image
97-
isChecked | React.PropTypes.bool | false | false | checkbox checked state
98-
onClick | React.PropTypes.func.isRequired | false | | callback function
95+
checkedImage | PropTypes.element | true | Default image | Custom checked Image
96+
unCheckedImage | PropTypes.element | true | Default image | Custom unchecked Image
97+
isChecked | PropTypes.bool | false | false | checkbox checked state
98+
onClick | PropTypes.func.isRequired | false | | callback function
9999

100100
## Contribution
101101

index.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,28 @@ import React, {Component} from 'react';
1111
import {
1212
StyleSheet,
1313
View,
14+
ViewPropTypes,
1415
Image,
1516
Text,
1617
TouchableHighlight
1718
} from 'react-native';
19+
import PropTypes from 'prop-types';
1820

1921

2022
export default class CheckBox extends Component {
2123
static propTypes = {
22-
...View.propTypes,
23-
leftText: React.PropTypes.string,
24-
leftTextView: React.PropTypes.element,
25-
rightText: React.PropTypes.string,
24+
...(ViewPropTypes || View.PropTypes),
25+
leftText: PropTypes.string,
26+
leftTextView: PropTypes.element,
27+
rightText: PropTypes.string,
2628
leftTextStyle: Text.propTypes.style,
27-
rightTextView: React.PropTypes.element,
29+
rightTextView: PropTypes.element,
2830
rightTextStyle: Text.propTypes.style,
29-
checkedImage: React.PropTypes.element,
30-
unCheckedImage: React.PropTypes.element,
31-
onClick: React.PropTypes.func.isRequired,
32-
isChecked: React.PropTypes.bool.isRequired,
33-
checkBoxColor: React.PropTypes.string,
31+
checkedImage: PropTypes.element,
32+
unCheckedImage: PropTypes.element,
33+
onClick: PropTypes.func.isRequired,
34+
isChecked: PropTypes.bool.isRequired,
35+
checkBoxColor: PropTypes.string,
3436
}
3537
static defaultProps = {
3638
isChecked: false,

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"bugs": {
2727
"url": "https://github.com/crazycodeboy/react-native-check-box/issues"
2828
},
29+
"dependencies": {
30+
"prop-types": "^15.5.7"
31+
},
2932
"peerDependencies": {
3033
"react-native": ">=0.20.0"
3134
},

0 commit comments

Comments
 (0)