Redux-Form 中的可编辑组合框

Editable combo box in Redux-Form

与此线程类似的内容:How can I create an editable combo box in HTML/Javascript?

是否可以在 Redux-Form 中使用组合框表单?

这对我有用:

<Field
    options={[
      {value: 1, text: 'Option1'},
      {value: 2, text: 'Option2'}
    ]}
    component={Select}
    label="My select question"
    className="col-md-6"
  />

const Select = ({input, options, label, error}) => {
  if (error && error.length > 0) {
    className += " " + 'has-error'
  }
  return (
    <div className={className}>
      {label && <label htmlFor={input.name}>{label}</label>}
        <select {...input} >
          {options.map(function (option, i) {
            return (
              <option
                value={option.value}
                key={i}
              >
                {option.text}
              </option>)
          })}
        </select>
        {error && <div className="alert alert-danger">{error}</div>}
    </div>
  )
}