diff --git a/RadioButtonRN.js b/RadioButtonRN.js index 4756e29..386e29e 100644 --- a/RadioButtonRN.js +++ b/RadioButtonRN.js @@ -75,6 +75,14 @@ class RadioButtonRN extends React.Component { this._checkAnimatons(); } } + + reset(){ + this.setState({activeIndex: -1}); + } + + setActive(item, activeIndex){ + this._changeRadio(item, activeIndex); + } _checkAnimatons() { const { animationTypes } = this.props; @@ -116,7 +124,7 @@ class RadioButtonRN extends React.Component { render() { let { activeIndex, fadeAnim, animations } = this.state; - let { boxStyle, style, circleSize, textStyle, data, icon, activeColor, deactiveColor, boxActiveBgColor, boxDeactiveBgColor, box, textColor } = this.props; + let { boxStyle, style, circleSize, textStyle, data, icon, activeColor, deactiveColor, boxActiveBgColor, boxDeactiveBgColor, box, textColor, disabled } = this.props; return ( @@ -133,15 +141,16 @@ class RadioButtonRN extends React.Component { , boxStyle]} activeOpacity={0.9} onPress={() => this._changeRadio(item, index)} + disabled={disabled} > @@ -268,4 +277,4 @@ RadioButtonRN.defaultProps = { }; /* Export Component ============================ */ -export default RadioButtonRN; \ No newline at end of file +export default RadioButtonRN;