i have used the same but did not get item key when click on the radio button.
can you please share your code?
RadioButton.js
class RadioButton extends Component { constructor(props) { super(props) this.state = { value: null, Arr: [] } } _renderRadioButton() { return this.props.Arr.map((item, i) => { return ( {item.text} style={Styles.radioCircleStyles} onPress={this.props.onPress} > {this.props.value === item.key && ()} ) }) }
render() { return ( <View style={Styles.radioButtonMainContainerStyles} > {this._renderRadioButton()} </View> ) }
}
APP.jS
this._handleRadioButton(item)} value ={this.state.value}/>
Please find the screenshot for the error Or Send me your email-id i will share you my code.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
i have used the same but did not get item key when click on the radio button.
can you please share your code?
RadioButton.js
class RadioButton extends Component {
constructor(props) {
super(props)
this.state = {
value: null,
Arr: []
}
}
_renderRadioButton() {
return this.props.Arr.map((item, i) => {
return (
{item.text}
style={Styles.radioCircleStyles}
onPress={this.props.onPress}
>
{this.props.value === item.key && ()}
)
})
}
}
APP.jS
this._handleRadioButton(item)} value ={this.state.value}/>
Please find the screenshot for the error
Or Send me your email-id i will share you my code.