Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom input props for TextField #649

Closed
totopia opened this issue May 15, 2015 · 3 comments
Closed

Custom input props for TextField #649

totopia opened this issue May 15, 2015 · 3 comments
Labels
component: text field This is the name of the generic UI component, not the React module!

Comments

@totopia
Copy link

totopia commented May 15, 2015

I am trying to pass some custom input props to Textfield,

seeing the source here: https://github.com/callemall/material-ui/blob/master/src/text-field.jsx#L241
But I am not sure what {... does....is it using the local var values on Parent element or it is taking the inputProps as a prop I can set as part of

@troutowicz
Copy link
Contributor

... is the spread operator. React's implementation takes the properties of the object and expands them into component properties. It is used to handle all possible component properties that may or may not be getting used in any instance.

https://facebook.github.io/react/docs/jsx-spread.html

@totopia
Copy link
Author

totopia commented May 15, 2015

i see...interesting. I see that allowed me to use TextField just like another , and it knows to pass the props to the input inside the component. Pretty awesome trick.

@hai-cea
Copy link
Member

hai-cea commented Jun 3, 2015

Thanks @troutowicz

@hai-cea hai-cea closed this as completed Jun 3, 2015
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added component: text field This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

5 participants