-
Notifications
You must be signed in to change notification settings - Fork 649
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
Conversation
src/CSSTransition.js
Outdated
@@ -140,9 +143,10 @@ class CSSTransition extends React.Component { | |||
|
|||
getClassNames = (type) => { | |||
const { classNames } = this.props; | |||
const prefix = classNames ? classNames + '-' : ''; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
thanks! |
# [2.8.0](v2.7.1...v2.8.0) (2019-04-02) ### Features * add support for empty classNames ([#481](#481)) ([d755dc6](d755dc6))
🎉 This PR is included in version 2.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…ransition/>` Since v2.8.0, classNames prop has been optional. See also: - https://github.com/reactjs/react-transition-group/blob/v2.8.0/CHANGELOG.md - reactjs/react-transition-group#481
# [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))
# [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))
# [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))
# [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))
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
-
.