Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 未捕获的TypeError:_this.props.saveApp(…)。then不是函数_Reactjs_React Native_React Redux - Fatal编程技术网

Reactjs 未捕获的TypeError:_this.props.saveApp(…)。then不是函数

Reactjs 未捕获的TypeError:_this.props.saveApp(…)。then不是函数,reactjs,react-native,react-redux,Reactjs,React Native,React Redux,我在用react redux 以下是我的行动 你需要在行动中回报承诺,而且回应没有在正确的地方回报。请参阅我的评论以了解我编辑的内容: 导出函数saveApp(appvalue,fdata){ 返回调度=>{ 退货请求//您需要在此处添加退货!! .post(\'http://appplay.net:8082/api/v1/addFile\') .send(fdata) .然后(功能(res){ //res.body、res.headers、res.status console.log(res.

我在用react redux

以下是我的行动


你需要在行动中回报承诺,而且回应没有在正确的地方回报。请参阅我的评论以了解我编辑的内容:

导出函数saveApp(appvalue,fdata){
返回调度=>{
退货请求//您需要在此处添加退货!!
.post(\'http://appplay.net:8082/api/v1/addFile\')
.send(fdata)
.然后(功能(res){
//res.body、res.headers、res.status
console.log(res.body.data);
var downloadurl=res.body.data;
//console.log(值);
//this.saveApp(值,下载URL);
变量platfrom1=(appvalue.Platform==“iOS”)?“2”:“1”;
var ref_newapp=db.ref().child(“应用程序”);
var auto_id=ref_newapp.push();
自动识别码设置({
“App_图标”:appvalue.appicon,
“App_Name”:appvalue.appname,
“下载URL”:下载URL,
“是活动的”:parseInt(appvalue.radiostatus,10),
“平台”:parseInt(平台1,10),
“版本”:appvalue.Version
});
return res;//我想您应该在这里返回res!!
})
.catch(函数(err){
//err.message,err.response
});
}
}

如果您复制了原始代码,请在此处发布整个组件代码?
返回disptch=>
输入错误。除此之外,请确保已将操作连接到
connect()
,并且已正确导入该操作。@Christos Dimitroulas完整组件代码
// Component code
this.props.saveApp(values, data).then((result) => {
          //do something

}).catch((error) => {

});