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

cx has trailing whitespace #523

Closed
staylor opened this issue Jan 8, 2018 · 2 comments · Fixed by #532
Closed

cx has trailing whitespace #523

staylor opened this issue Jan 8, 2018 · 2 comments · Fixed by #532
Labels

Comments

@staylor
Copy link

staylor commented Jan 8, 2018

  • emotion version: 9.0.0-1
  • react version: 16.2

Relevant code.

cx('guyFieri', {
  donkeySauce: true,
})

What you did:

I want to replace classnames with cx

What happened:

There is extra whitespace at the end of the class names.

Reproduction:

Just use cx

Problem description:

If you have hundreds of components, this creates unnecessary snapshot churn, and feels/smells like a code smell.

Suggested solution:

Trim whitespace from className or alter existing logic to not always push trailing whitespace on the next local var

@emmatown
Copy link
Member

emmatown commented Jan 8, 2018

I can't seem to reproduce this. https://codesandbox.io/s/6xjk5p5n03

@staylor
Copy link
Author

staylor commented Jan 11, 2018

sorry about that, here is a codesandbox with examples of extra whitespace: https://codesandbox.io/s/oop6pz4w25

If the default props are set to null, but are of type PropTypes.string, snapshots will render null as a string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants