react / react-0.13.3 / examples / basic-commonjs / node_modules / react / lib / ReactCSSTransitionGroup.js
81143 views/**1* Copyright 2013-2015, Facebook, Inc.2* All rights reserved.3*4* This source code is licensed under the BSD-style license found in the5* LICENSE file in the root directory of this source tree. An additional grant6* of patent rights can be found in the PATENTS file in the same directory.7*8* @typechecks9* @providesModule ReactCSSTransitionGroup10*/1112'use strict';1314var React = require("./React");1516var assign = require("./Object.assign");1718var ReactTransitionGroup = React.createFactory(19require("./ReactTransitionGroup")20);21var ReactCSSTransitionGroupChild = React.createFactory(22require("./ReactCSSTransitionGroupChild")23);2425var ReactCSSTransitionGroup = React.createClass({26displayName: 'ReactCSSTransitionGroup',2728propTypes: {29transitionName: React.PropTypes.string.isRequired,30transitionAppear: React.PropTypes.bool,31transitionEnter: React.PropTypes.bool,32transitionLeave: React.PropTypes.bool33},3435getDefaultProps: function() {36return {37transitionAppear: false,38transitionEnter: true,39transitionLeave: true40};41},4243_wrapChild: function(child) {44// We need to provide this childFactory so that45// ReactCSSTransitionGroupChild can receive updates to name, enter, and46// leave while it is leaving.47return ReactCSSTransitionGroupChild(48{49name: this.props.transitionName,50appear: this.props.transitionAppear,51enter: this.props.transitionEnter,52leave: this.props.transitionLeave53},54child55);56},5758render: function() {59return (60ReactTransitionGroup(61assign({}, this.props, {childFactory: this._wrapChild})62)63);64}65});6667module.exports = ReactCSSTransitionGroup;686970