-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Classes & Props: Input #35
Conversation
import classNames from 'classnames'; | ||
|
||
class Input extends Component { | ||
export default class Input extends Component { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export inline
{icon: !!this.props.iconClass}, | ||
'input' | ||
); | ||
let inputProps = _.clone(this.props); | ||
delete inputProps.className; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to spread non class props on the input, the classes are spread on the containing div.
Looks good. 🐙 |
</div> | ||
</Field> | ||
<div className={classes}> | ||
<input {...inputProps} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this a lot more than trying to be magical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
🍂 |
No description provided.