-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
I want to set initial selected option to SegmentedControls.
options = [
{
label: 'user1',
value: 'user1'
},
{
label: 'user2',
value: 'user2'
}
]
constructor(props) {
super(props);
this.state = {
selectedOption: {label: "user1", value: "user1"},
}
}
<SegmentedControls
options={ options }
onSelection={ setSelectedOption.bind(this) }
selectedOption={ this.state.selectedOption }
extractText={ (option) => option.label }
testOptionEqual={(selectedValue, option) => selectedValue === option.value}
/>
However, when app is started initial option is not applied to SegmentedControls.
Even though I remove testOptionEqual props, it shows same result.
What's the problem?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels