Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/459.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 印刷道具的反应方式 我试图在main.js中包含我的公共组件 这一次我做得很成功 但在我的公共组件中,我试图打印我的redux数据值 所以我创建了一个名为handleClickForRedux的方法来打印这些值 我已经包括了mapStateToProps和mapDispatchToProps 但此行仍没有打印值控制台.log(“事件reddux道具-->”,道具); 你能告诉我怎么修吗 下面提供我的代码片段和沙盒_Javascript_Html_Css_Reactjs_Redux - Fatal编程技术网

Javascript 印刷道具的反应方式 我试图在main.js中包含我的公共组件 这一次我做得很成功 但在我的公共组件中,我试图打印我的redux数据值 所以我创建了一个名为handleClickForRedux的方法来打印这些值 我已经包括了mapStateToProps和mapDispatchToProps 但此行仍没有打印值控制台.log(“事件reddux道具-->”,道具); 你能告诉我怎么修吗 下面提供我的代码片段和沙盒

Javascript 印刷道具的反应方式 我试图在main.js中包含我的公共组件 这一次我做得很成功 但在我的公共组件中,我试图打印我的redux数据值 所以我创建了一个名为handleClickForRedux的方法来打印这些值 我已经包括了mapStateToProps和mapDispatchToProps 但此行仍没有打印值控制台.log(“事件reddux道具-->”,道具); 你能告诉我怎么修吗 下面提供我的代码片段和沙盒,javascript,html,css,reactjs,redux,Javascript,Html,Css,Reactjs,Redux,scroll.js import React,{useffect,useState,Fragment}来自“React”; 从“道具类型”导入道具类型; 从“@material ui/core/styles”导入{withStyles}”; 从“@物料界面/核心/卡片”导入卡片; //从“@material ui/core/CardActions”导入CardActions; 从“@material ui/core/CardContent”导入CardContent; 从“@material u

scroll.js

import React,{useffect,useState,Fragment}来自“React”;
从“道具类型”导入道具类型;
从“@material ui/core/styles”导入{withStyles}”;
从“@物料界面/核心/卡片”导入卡片;
//从“@material ui/core/CardActions”导入CardActions;
从“@material ui/core/CardContent”导入CardContent;
从“@material ui/core/Typography”导入排版;
从“@物料界面/核心/抽屉”导入抽屉;
从“redux”导入{bindActionCreators};
从“./actions/actionCreators”导入*作为actionCreators;
从“react redux”导入{connect};
从“redux”导入{compose};
功能运动鼠标(类、道具){
//const[canEdit,setCanEdit]=useState(false);
函数handleClickForRedux(事件){
console.log(“事件-->”,事件);
log(“事件reddux道具-->”,道具);
}
返回(
我在这里
);
}
SportsMouse.propTypes={
类:PropTypes.object.isRequired
};
函数MapStateTops(状态){
返回{
职位:state.posts,
评论:state.comments
};
}
功能图DispatchToprops(调度){
返回bindActionCreators(actionCreators,调度);
}
导出默认组合(
连接(
MapStateTops,
mapDispatchToProps
)
)(运动鼠标);
main.js

从“React”导入React;
从“react router dom”导入{Link};
从“./commonComponents/Scroll”导入滚动条;
常量Main=props=>{
const{children,match,…rest}=props;
返回(
雷多克斯泰格拉姆
{React.Children.map(Children,child=>React.cloneElement(child,rest))}
);
};
导出默认主;

即使在使用材质ui时,组件也只接受一个参数<代码>类存在于
道具中
。如果您
console.log(classes)
,您将看到它包含您的所有道具,包括材质ui的样式。应该是这样的:

function SportsMouse(props) {

该组件在您提供的沙箱中的何处?