简体   繁体   English

如何将多个表单(屏幕)数据发送到 React Native 中的同一个请求

[英]how to send the multiple form (screen) data to the same request in react native

i want to send the multiple form details to the single api in react native我想将多个表单详细信息发送到 react native 中的单个 api

one of my friend suggest me to try to make a form object inside the parent component and then pass the form object to the children form and bind it.我的一个朋友建议我尝试在父组件内部创建一个表单 object,然后将表单 object 传递给子表单并绑定它。 And then on Submit just post the data which is in the object. but i'm new to this and i'm not getting how to do that if anybody share me the sample code.然后在 Submit 上发布 object 中的数据。但我是新手,如果有人与我分享示例代码,我不知道该怎么做。 i mean example how to do that'll be helpful我的意思是如何做的例子会有所帮助

That should be easy:这应该很容易:

var formData = new FormData();
fromData.append('key1','value1');
fromData.append('key2','value2');

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

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