Skip to content

Instantly share code, notes, and snippets.

@julianlconnor
Last active August 29, 2015 14:01
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save julianlconnor/9023e4cbe7ef5499b6a0 to your computer and use it in GitHub Desktop.
Testable React CSS Transition Group
/** @jsx React.DOM */
define([
'react',
], function(React) {
var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
var TestableCSSTransitionGroup = React.createClass({
getDefaultProps: function() {
var shouldTransition = !window.TESTING;
return {
transitionEnter: shouldTransition,
transitionLeave: shouldTransition
};
},
render: function() {
return this.transferPropsTo(
<ReactCSSTransitionGroup>
{this.props.children}
</ReactCSSTransitionGroup>
);
}
});
return TestableCSSTransitionGroup;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment