Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

material-ui

I want to set a hidden property for the sign in button,

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

but doesnt seem to work. any suggestions?

like image 568
6by3 Avatar asked Mar 12 '23 11:03

6by3


1 Answers

This works for me

The expected behaviour for your snippet above:

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

should place an id attribute onto the button element created by RaisedButton.

I haven't tried this in other versions but in MUI 0.17.4. this works as expected.

Note: it is the button element that the id attribute is applied to not the root div element.

Also, id is one of the props specifically looked for and applied to the button so Id or ID would be ignored. I couldn't find in the source where this happens but I did test.

If that isn't helpful then let us know the MUI version, and the specific steps we can take to reproduce.

like image 166
tharon-c Avatar answered Mar 15 '23 19:03

tharon-c