Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Use classnames & lint fix #22

Merged
merged 2 commits into from
Mar 7, 2015
Merged

Use classnames & lint fix #22

merged 2 commits into from
Mar 7, 2015

Conversation

rhobot
Copy link
Contributor

@rhobot rhobot commented Mar 6, 2015

In React 0.13, classSet will be deprecated and using classnames is recommended.

@cain-wang
Copy link
Contributor

Thanks for embracing the new feature!
Probably we could do something automatically when developers give an array or an object to className, we automatically wrap the value using classnames?
Like:

r(SomeComponent, {
  className: ['class1', 'class2'] => className: classnames('class1', 'class2')
})
r(SomeComponent, {
  className: {'class1': true, 'class2': false} => className: classnames({'class1': true, 'class2': false})
})

@rhobot
Copy link
Contributor Author

rhobot commented Mar 6, 2015

I agree, but this may confuse some users because className is always a string in React.
But if most of us agree, I'm happy to add the feature.

rhobot pushed a commit that referenced this pull request Mar 7, 2015
Use classnames & lint fix
@rhobot rhobot merged commit 64d7812 into master Mar 7, 2015
@rhobot rhobot deleted the classnames branch March 7, 2015 06:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants