Amr M. AbdulRahman Amr M. AbdulRahman - 1 month ago 41
React JSX Question

Autofocus TextField using React Material-UI

I use Material-UI TextField

I want to implement an autofocus, I can't find a way to do it from markup by setting

autofocus=true
not programmatically. any help?

Answer

You can do this like this: <TextField autoFocus={true} ></TextField>.

More on this: https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes.

Comments