React JS - How to add style in PaperProps of Dialo

2019-08-16 17:17发布

I am using Dialog components from material-ui ReactJs.

<Dialog fullScreen open={this.state.open}
  PaperProps={{ classes: {root: classes.dialogPaper} }}
  onClose={this.handleClose.bind(this)} transition={this.props.transition}>
  {this.props.children}
</Dialog>

In the above code I already override the root classes of PaperProps. Now I also want to override the style in the PaperProps. Is that possible in the PaperProps to override the styles.

Something like PaperProps={{ classes: {root: classes.dialogPaper}, style:{} }}

Please tell me if I am wrong. I want to override style also.

1条回答
贪生不怕死
2楼-- · 2019-08-16 18:11

I got my answer

<Dialog
{...otherProps}
  PaperProps={{
    style: {
      backgroundColor: 'transparent',
      boxShadow: 'none',
    },
  }}
>
  {/* ... your content ... */}
</Dialog>

This is how we can put style in PaperProps of dialog component.

查看更多
登录 后发表回答