From 5e5bc9a21680c971cf9f7e7b228112fd94e5ac27 Mon Sep 17 00:00:00 2001 From: Kim Helberg Date: Wed, 11 Apr 2018 21:55:08 +0200 Subject: [PATCH 1/4] Catch external state change --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 07d09f1..aead632 100755 --- a/index.js +++ b/index.js @@ -26,6 +26,11 @@ export default class CheckBox extends Component { isChecked: this.props.isChecked, } } + componentWillReceiveProps(nextProps) { + if (this.props.isChecked !== nextProps.isChecked) { + this.setState({isChecked: nextProps.isChecked}); + } + } static propTypes = { ...(ViewPropTypes || View.PropTypes), leftText: PropTypes.string, From b52cbd4b3e062c4d667d76110f288a9a71203b24 Mon Sep 17 00:00:00 2001 From: Kim Helberg Date: Wed, 6 Jun 2018 00:27:41 +0200 Subject: [PATCH 2/4] Support for numberOfLines To control text wrapping. --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index aead632..944d823 100755 --- a/index.js +++ b/index.js @@ -46,6 +46,7 @@ export default class CheckBox extends Component { isIndeterminate: PropTypes.bool.isRequired, checkBoxColor: PropTypes.string, disabled: PropTypes.bool, + numberOfLines: PropTypes.number } static defaultProps = { isChecked: false, @@ -72,14 +73,14 @@ export default class CheckBox extends Component { if (this.props.leftTextView)return this.props.leftTextView; if (!this.props.leftText)return null; return ( - {this.props.leftText} + {this.props.leftText} ); } _renderRight() { if (this.props.rightTextView)return this.props.rightTextView; if (!this.props.rightText)return null; return ( - {this.props.rightText} + {this.props.rightText} ); } From 973ff8c00d5a50268eb326c079d99c9d089c1506 Mon Sep 17 00:00:00 2001 From: Kim Helberg Date: Tue, 31 Mar 2020 21:09:37 +0200 Subject: [PATCH 3/4] Remove componentWillReceiveProps --- index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/index.js b/index.js index 944d823..58342d3 100755 --- a/index.js +++ b/index.js @@ -26,11 +26,6 @@ export default class CheckBox extends Component { isChecked: this.props.isChecked, } } - componentWillReceiveProps(nextProps) { - if (this.props.isChecked !== nextProps.isChecked) { - this.setState({isChecked: nextProps.isChecked}); - } - } static propTypes = { ...(ViewPropTypes || View.PropTypes), leftText: PropTypes.string, From 92c363aef4baa722463421ad4d302bb820fb2043 Mon Sep 17 00:00:00 2001 From: Kim Helberg Date: Thu, 2 Apr 2020 10:54:12 +0200 Subject: [PATCH 4/4] Up version number. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 658c3e1..1e3427c 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-check-box", - "version": "2.1.0", + "version": "2.1.1", "description": "Checkbox component for react native, it works on iOS and Android.", "main": "index.js", "scripts": {