Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.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
Javascript Reactjs中没有父函数的调用_Javascript_Jquery_Ruby On Rails_Reactjs - Fatal编程技术网

Javascript Reactjs中没有父函数的调用

Javascript Reactjs中没有父函数的调用,javascript,jquery,ruby-on-rails,reactjs,Javascript,Jquery,Ruby On Rails,Reactjs,我在Reactjs中有两个函数。当函数一调用函数二的函数时。有与相同的错误 “未捕获类型错误:this.props.onButonShowClick不是函数” 这是功能一: var HiddenEdit=React.createClass({ _点击:功能(e){ e、 preventDefault(), this.props.onButtonShowClick(true); }, render:function(){ 返回( ); } }); 这是一个函数2 var ChapterList=

我在Reactjs中有两个函数。当函数一调用函数二的函数时。有与相同的错误

“未捕获类型错误:this.props.onButonShowClick不是函数”

这是功能一:

var HiddenEdit=React.createClass({
_点击:功能(e){
e、 preventDefault(),
this.props.onButtonShowClick(true);
},
render:function(){
返回(
);
}
});
这是一个函数2

var ChapterList=React.createClass({
_handleOnPaginate:函数(页码){
this.props.inPagenate(页码)
},
getInitialState:函数(){
返回{
childVisible:错误
};
},
_handleOnClick:函数(参数){
this.state.childVisible=params;
},
render:function(){
var showEdit=this.state.childVisible;
var chapterNodes=this.props.data.chapters.map(函数(章,索引){
var url_chapter_detail=“/admin/chapters/”+chapter.chapter_id+”/chapter_details”;
var btn_edit=“btn edit chapter-”+chapter.chapter_id;
var href_delete=“/admin/mangas/”+chapter.manga_id+”/chapters/“+chapter.chapter_id;
var div_chapter=“chapter-”+chapter.chapter_id;
返回(
{
显示编辑?:
}
);
});
返回(
{chapterNodes}
);
}
});

有人能帮我解决这个问题吗?

好吧,这个在数组映射的回调中是未定义的。()

作为onButtonShowClick道具传递的值也是如此

<HiddenEdit onButonShowClick={this._handleOnClick} url_detail={url_chapter_detail} id_chapter="btn_edit" />

此外,您还应该看看React关于动态子对象的文档

您在哪里调用第一个函数中的第二个函数?我找不到它。
var chapterNodes = this.props.data.chapters.map(function(chapter, index) { /*...*/ }, this);