Skip to content

Instantly share code, notes, and snippets.

@benjamn
Forked from julianlconnor/testable.js
Created May 9, 2014 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamn/eb6887f2f7b0a8d2db2c to your computer and use it in GitHub Desktop.
Save benjamn/eb6887f2f7b0a8d2db2c to your computer and use it in GitHub Desktop.
/** @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