如何将初始值传递给具有选择字段的表单-React Final Form?
<Field className="input" name="pergunta_1" component="select">
<option>---</option>
<option>Sim</option>
<option>Não</option>
</Field>
答案 0 :(得分:0)
您可以如下循环浏览选项列表:
<Field className="input" name="pergunta_1" component="select">
<option>---</option>
{allFieldDisplay.map((each, index) => (
<option value={each.fieldValue} key={index}>{each.fieldName}</option>
))}
</Field>