prscX / react-native-shine-button

React Native: Native Shine Button - Effects like shining
Apache License 2.0
356 stars 37 forks source link

onChange returning wrong value #24

Open harshalijain opened 4 years ago

harshalijain commented 4 years ago

onChange is always returning false. Looked into the JS code,found this

_onChange = event => {
    let value = false;
    if (event.nativeEvent.value === "YES") value = true;

    this.props.onChange && this.props.onChange(value);

    this._shineButton.setNativeProps({ on: event.nativeEvent.value });
  };

After debugging, I found out that event.nativeEvent.value returns boolean 'true' or 'false' according to the action performed. But because of the above condition, value is always set to 'false'