简体   繁体   English

使用Redux和React处理表单

[英]Process a form with Redux and React

I want to process a form and post its fields. 我想处理一个表单并发布其字段。 I'm learning Redux and I want to use it for the form processing. 我正在学习Redux,我想将其用于表单处理。 The question is: what should I do in order to accomplish this task? 问题是:为了完成这项任务我应该怎么做? Should I put the fields as part of the object (state)? 我应该将字段作为对象(状态)的一部分吗? What do you suggest? 你有什么建议?

Thank you 谢谢

What exactly are you trying to do? 您到底想做什么? If you want to stick close to the metal with Redux, I recommend React-Redux-Form as it allows you to define your own reducers and handle your data model the way you want to. 如果您想使用Redux紧贴金属,我建议使用React-Redux-Form,因为它允许您定义自己的reducer并以所需的方式处理数据模型。

Here is a quick start guide: https://davidkpiano.gitbooks.io/react-redux-form/content/step_by_step.html 这是一个快速入门指南: https : //davidkpiano.gitbooks.io/react-redux-form/content/step_by_step.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM