I have a question. How link value of selected radio button in RkChoiceGroup
<RkChoiceGroup radio style={styles.radioGroup} selectedIndex={1}>
<TouchableOpacity choiceTrigger onPress={() => console.log('puff')}>
<View style={[styles.radioRow, styles.spaceBottom]}>
<RkChoice rkType='radio' style={styles.radio} onPress={() => console.log('puff')}/>
<RkText rkType='bold'>Female</RkText>
</View>
</TouchableOpacity>
<TouchableOpacity choiceTrigger onPress={() => console.log('puff')}>
<View style={styles.radioRow}>
<RkChoice rkType='radio' style={styles.radio} onPress={() => console.log('puff')}/>
<RkText rkType='bold'>Male</RkText>
</View>
</TouchableOpacity>
</RkChoiceGroup>
OK i answer by myself. Correct use is:
<RkChoiceGroup radio style={styles.radioGroup} selectedIndex={0} onChange={(id) => console.log('id: ', id)} >
<TouchableOpacity choiceTrigger>
<View style={[styles.radioRow, styles.spaceBottom]}>
<RkChoice rkType='radio' style={styles.radio} />
<RkText rkType='bold'>Female</RkText>
</View>
</TouchableOpacity>
<TouchableOpacity choiceTrigger >
<View style={styles.radioRow}>
<RkChoice rkType='radio' style={styles.radio} />
<RkText rkType='bold'>Male</RkText>
</View>
</TouchableOpacity>
</RkChoiceGroup>
Thanks, I think it should be on the docs
Done
Most helpful comment
OK i answer by myself. Correct use is: