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

Classes & Props: Input #35

Merged
merged 3 commits into from
Oct 8, 2015
Merged

Classes & Props: Input #35

merged 3 commits into from
Oct 8, 2015

Conversation

levithomason
Copy link
Member

No description provided.

import classNames from 'classnames';

class Input extends Component {
export default class Input extends Component {
Copy link
Member Author

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;
Copy link
Member Author

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.

@athurman
Copy link
Contributor

athurman commented Oct 8, 2015

Looks good. 🐙

</div>
</Field>
<div className={classes}>
<input {...inputProps} />
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@eanplatter
Copy link
Contributor

🍂

levithomason added a commit that referenced this pull request Oct 8, 2015
@levithomason levithomason merged commit 8795c26 into master Oct 8, 2015
@levithomason levithomason deleted the feature/input-classes-props branch October 8, 2015 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants