如何为 material ui Raised Button 组件添加 Id?

How to add an Id for material ui Raised Button component?

我想为登录按钮设置隐藏 属性,

 <RaisedButton id='signInButton' label="Sign in" />

但似乎不起作用。 有什么建议吗?

这对我有用

以上代码段的预期行为:

<RaisedButton id='signInButton' label="Sign in" />

应该将 id 属性放置到 RaisedButton 创建的 button 元素上。

我没有在其他版本中尝试过,但在 MUI 0.17.4 中尝试过。这按预期工作。

注意:id 属性应用于 button 元素而不是根 div 元素。

此外,id 是专门寻找并应用于 button 的道具之一,因此 IdID 将被忽略。我在源代码中找不到发生这种情况的地方,但我进行了测试。

如果这没有帮助,请告诉我们 MUI 版本,以及我们可以采取的重现具体步骤。