Navigation Menu

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

Add support for empty classNames #481

Merged
merged 1 commit into from Apr 2, 2019
Merged

Add support for empty classNames #481

merged 1 commit into from Apr 2, 2019

Conversation

danielhusar
Copy link
Contributor

Hey!

I think it would be quite usefull if classNames prop would be optional, and it would still work without it.

In our use-case we are using it together with styled components and it's quite annoying to add those prefixes all the time, when component styles are already scoped.

Also if you pass empty string, it adds classes beginning with -.

@@ -140,9 +143,10 @@ class CSSTransition extends React.Component {

getClassNames = (type) => {
const { classNames } = this.props;
const prefix = classNames ? classNames + '-' : '';
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd also check that it's a string to avoid concating an object to a string unnecessarily

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@jquense jquense merged commit d755dc6 into reactjs:master Apr 2, 2019
@jquense
Copy link
Collaborator

jquense commented Apr 2, 2019

thanks!

jquense pushed a commit that referenced this pull request Apr 2, 2019
# [2.8.0](v2.7.1...v2.8.0) (2019-04-02)

### Features

* add support for empty classNames ([#481](#481)) ([d755dc6](d755dc6))
@jquense
Copy link
Collaborator

jquense commented Apr 2, 2019

🎉 This PR is included in version 2.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

alesn pushed a commit to alesn/DefinitelyTyped that referenced this pull request Apr 23, 2019
johnfrench3 pushed a commit to johnfrench3/transition-group-react that referenced this pull request Nov 2, 2022
# [2.8.0](reactjs/react-transition-group@v2.7.1...v2.8.0) (2019-04-02)

### Features

* add support for empty classNames ([#481](reactjs/react-transition-group#481)) ([d755dc6](reactjs/react-transition-group@d755dc6))
patrickm68 added a commit to patrickm68/react-transition-group-developer that referenced this pull request Dec 1, 2022
shaikdev2 pushed a commit to shaikdev2/transition-group-react that referenced this pull request Jun 9, 2023
GreenCat1996 added a commit to GreenCat1996/react-transition-group that referenced this pull request Aug 1, 2023
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.

None yet

2 participants