From 8cb446112e37f206eaf4641c462cf8a09d296a21 Mon Sep 17 00:00:00 2001 From: Ryan Gundu Date: Wed, 30 Oct 2019 10:56:10 -0400 Subject: [PATCH] Fixed _this7.props.onPress is not a function Spamming the radio buttons constantly resulted in a "_this7.props.onPress is not a function" error. --- lib/SimpleRadioButton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SimpleRadioButton.js b/lib/SimpleRadioButton.js index a737044..9f25edd 100644 --- a/lib/SimpleRadioButton.js +++ b/lib/SimpleRadioButton.js @@ -266,7 +266,7 @@ export class RadioButtonLabel extends React.Component { accessibilityLabel={this.props.accessibilityLabel} testID={this.props.testID} onPress={() => { - if (!this.props.disabled) { + if (this.props.onPress && !this.props.disabled) { this.props.onPress( this.props.obj.value, this.props.index)} } }>