thegamenicorus / react-native-flexi-radio-button

Simple and flexible Radio button for React Native App
https://www.npmjs.com/package/react-native-flexi-radio-button
MIT License
159 stars 64 forks source link

How do I get the value of the selected item? #11

Closed java773863202 closed 7 years ago

java773863202 commented 7 years ago

How do I get the value of the selected item?

thegamenicorus commented 7 years ago

Hello @java773863202

You can get both index and value from 'onSelect' of RadioGroup

<RadioGroup 
    //...other props
    onSelect={this.onSelect}
>
   //...radio buttons
</RadioGroup>

onSelect(index, value){
    this.setState({
        selectedIndex: index
        selectedValue: value
    })
}
thegamenicorus commented 7 years ago

If this issue still a problem, please re-open issue again