gpt4 book ai didi

reactjs - Material -UI v3 : How do you use the TouchRipple component?

转载 作者:行者123 更新时间:2023-12-03 13:43:49 25 4
gpt4 key购买 nike

我正在尝试获取 Material UI 的 TouchRipple component以便我有时可以在 ButtonBase 组件之外使用链式 react 。然而,文档没有说明如何使用它。

在旧版本的 Material UI 中,似乎您应该将其包裹在 React 组件周围,但在 v3 中,它不起作用,因为它不带任何子组件。

如何在 Material UI v3 中使用 TouchRipple 组件?

最佳答案

Update for v4 — 3 of July 2019

createRippleHandler is no more. Still, ButtonBase is the best tool for what the question is asking for.

这并不完全是一个简单的实用程序。

如果您查看 ButtonBase,您会发现有 a lot of required things使其发挥作用。

基本上,您需要手动处理事件并要求 TouchRipple 启动新的波纹。

他们做了@material-ui/core/ButtonBase/createRippleHandler (确实在 ButtonBase 中使用)让他们的生活更轻松。

不推荐。改用ButtonBase

关于reactjs - Material -UI v3 : How do you use the TouchRipple component?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52392230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com