如何在Material Design React中禁用波纹 [英] How to disable ripple in Material Design React

查看:183
本文介绍了如何在Material Design React中禁用波纹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在谈论这个存储库. https://github.com/callemall/material-ui

I am talking about this repository. https://github.com/callemall/material-ui

我想知道如何禁用所有组件的波纹效应.

I want to know how to disable the ripple effect from all components.

谢谢.

推荐答案

您可以通过将默认属性添加到MUIThemeProvider内部最高级别的React组件的componentDidMount()中来禁用默认属性:

You can disable the default property by adding this to componentDidMount() at the highest level React component that is inside of the MUIThemeProvider:

componentDidMount(){
  //Do this to all components you would like to disable the ripple effect.
  EnhancedButton.defaultProps.disableTouchRipple = true;
  EnhancedButton.defaultProps.disableFocusRipple = true;
}

这篇关于如何在Material Design React中禁用波纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆