使用redux形式集成反应语义ui复选框

问题描述 投票:1回答:1

我想在一个反应​​语义UI中添加一个,但即使在我将Checkbox命名为这样之后,它也无法将检查的值发送到服务器:

<Form.Field
  label="The question is new to the intent library"
  name="newType"
  control={Field}
  component={Checkbox}
/>

这个组件在这样的表单中:

<Form>
 <Form.Field
  label="Rating"
  control={Field}
  name="rate"
  component={Rating}
  ...
 />
 <That checkbox ... />
 <Form.Field
  label="Comment"
  control={Field}
  name="comment"
  component="textarea"
 />
</Form>

假定的动作应该带有有效载荷中的检查值,类似于评级和评论的携带方式。

我被困在这里半天如果你发现了什么请帮助我。谢谢!

reactjs semantic-ui redux-form
1个回答
1
投票

使用以下代码解决了该问题

<Form.Field 
 control={Field}
 label="The question is new to the intent library"
 name="newType"
 component="input"
 type="checkbox"
/>
© www.soinside.com 2019 - 2024. All rights reserved.