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

Support className attribute #5

Merged
merged 1 commit into from
Apr 29, 2017

Conversation

nathancahill
Copy link
Collaborator

A lot of JSX uses className as an attribute for class, since class is a reserved keyword in ES6. This adds support. Adds 23 bytes (548 bytes to 571 bytes).

@developit
Copy link
Owner

Wondering if it'd be worth just inlining the conversion as a ternary? It can bypass esc() for the className case since "class" is hardcoded.

@nathancahill
Copy link
Collaborator Author

Word. Wasn't sure if there would be other special cases in the future, but that makes sense for now. Updating.

@nathancahill
Copy link
Collaborator Author

Great, now it only adds 17 bytes. (548 bytes to 565 bytes).

@developit
Copy link
Owner

sweet!

Copy link
Owner

@developit developit left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the test too!

@developit developit merged commit 8767d17 into developit:master Apr 29, 2017
@nathancahill nathancahill deleted the features/support-classname branch April 29, 2017 23:51
@eirslett
Copy link

eirslett commented Jul 4, 2017

Would be great to have a npm release with this patch!

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