Skip to content

Commit

Permalink
Merge pull request #28 from piuccio/master
Browse files Browse the repository at this point in the history
Remove deprecated proptypes
  • Loading branch information
crazycodeboy authored Jul 22, 2017
2 parents 2632555 + 06e356f commit af062a7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ renderCheckBox(data) {

Props | Type | Optional | Default | Description
----------------- | -------- | -------- | ----------- | -----------
style | View.propTypes.style | true | | Custom style checkbox
leftText | React.PropTypes.string |true | | Custom left Text
style | ViewPropTypes.style | true | | Custom style checkbox
leftText | PropTypes.string |true | | Custom left Text
leftTextStyle | Text.propTypes.style | true | | Custom left Text style
rightText | React.PropTypes.string |true | | Custom right Text
rightTextView | React.PropTypes.element | true | | Custom right TextView
rightText | PropTypes.string |true | | Custom right Text
rightTextView | PropTypes.element | true | | Custom right TextView
rightTextStyle | Text.propTypes.style | true | | Custom right Text style
checkedImage | React.PropTypes.element | true | Default image | Custom checked Image
unCheckedImage | React.PropTypes.element | true | Default image | Custom unchecked Image
isChecked | React.PropTypes.bool | false | false | checkbox checked state
onClick | React.PropTypes.func.isRequired | false | | callback function
checkedImage | PropTypes.element | true | Default image | Custom checked Image
unCheckedImage | PropTypes.element | true | Default image | Custom unchecked Image
isChecked | PropTypes.bool | false | false | checkbox checked state
onClick | PropTypes.func.isRequired | false | | callback function

## Contribution

Expand Down
22 changes: 12 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ import React, {Component} from 'react';
import {
StyleSheet,
View,
ViewPropTypes,
Image,
Text,
TouchableHighlight
} from 'react-native';
import PropTypes from 'prop-types';


export default class CheckBox extends Component {
static propTypes = {
...View.propTypes,
leftText: React.PropTypes.string,
leftTextView: React.PropTypes.element,
rightText: React.PropTypes.string,
...(ViewPropTypes || View.PropTypes),
leftText: PropTypes.string,
leftTextView: PropTypes.element,
rightText: PropTypes.string,
leftTextStyle: Text.propTypes.style,
rightTextView: React.PropTypes.element,
rightTextView: PropTypes.element,
rightTextStyle: Text.propTypes.style,
checkedImage: React.PropTypes.element,
unCheckedImage: React.PropTypes.element,
onClick: React.PropTypes.func.isRequired,
isChecked: React.PropTypes.bool.isRequired,
checkBoxColor: React.PropTypes.string,
checkedImage: PropTypes.element,
unCheckedImage: PropTypes.element,
onClick: PropTypes.func.isRequired,
isChecked: PropTypes.bool.isRequired,
checkBoxColor: PropTypes.string,
}
static defaultProps = {
isChecked: false,
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"bugs": {
"url": "https://github.com/crazycodeboy/react-native-check-box/issues"
},
"dependencies": {
"prop-types": "^15.5.7"
},
"peerDependencies": {
"react-native": ">=0.20.0"
},
Expand Down

0 comments on commit af062a7

Please sign in to comment.