() => {
class Example extends React.Component {
constructor(props) {
super(props)
this.state = { selected: 1 }
}
render() {
return (
<React.Fragment>
<RadioButton
selected={this.state.selected === 1}
onPress={() => this.setState({ selected: 1 })}
label="Option One"
/>
<StackSpacer size="large" />
<RadioButton
selected={this.state.selected === 2}
onPress={() => this.setState({ selected: 2 })}
label="Option Two"
/>
</React.Fragment>
)
}
}
return <Example />
}