Reactjs 如何在react boostrap multi-select上设置选定值?

Reactjs 如何在react boostrap multi-select上设置选定值?,reactjs,react-bootstrap,Reactjs,React Bootstrap,我一直在尝试这样的事情: <FormControl componentClass="select" multiple value="['other1', 'other2']"> <option value="other1">other1</option> <option value="other2">other2</option> <option value="other3">other3</option&

我一直在尝试这样的事情:

<FormControl componentClass="select" multiple value="['other1', 'other2']">
  <option value="other1">other1</option>
  <option value="other2">other2</option>
  <option value="other3">other3</option>
  <option value="other4">other4</option>
  <option value="other5">other5</option>
</FormControl>

其他1
其他2
其他3
其他4
其他5

但我无法得到正确的语法,也不确定这是否是正确的方法。

我在这里找到了答案:

注意:您可以将数组传递到value属性中,以便 在选择标记中选择多个选项:

根据我最初的示例,这是正确的方法:

<FormControl componentClass="select" multiple value={['other1', 'other2']}>
  <option value="other1">other1</option>
  <option value="other2">other2</option>
  <option value="other3">other3</option>
  <option value="other4">other4</option>
  <option value="other5">other5</option>
</FormControl>

其他1
其他2
其他3
其他4
其他5