我有一个Semantic UI React Dropdown Form.Field
,我正在尝试将默认值设置为English
,我该怎么做?
<Form.Field
name="languageSkills"
label=""
placeholder="Language"
value={this.state.reviewerSearch.languageSkills['English']}
onChange={this.handleSearchFilterChange}
category={'languages'}
control={LookupDropdown}
fluid
multiple
search
selection
/>
答案 0 :(得分:1)
我认为您正在寻找defaultValue,
<Form.Field
name="languageSkills"
label=""
placeholder="Language"
defaultValue={this.state.reviewerSearch.languageSkills['English']}
onChange={this.handleSearchFilterChange}
category={'languages'}
control={LookupDropdown}
fluid
multiple
search
selection
/>