Add support for appear and appear-active classes

This commit is contained in:
alexpien
2015-06-15 12:05:18 -07:00
parent 6e5b0248db
commit f1e524b0b1
2 changed files with 11 additions and 4 deletions
+6 -2
View File
@@ -85,6 +85,7 @@ You'll notice that when you try to remove an item `ReactCSSTransitionGroup` keep
```
### Custom Classes ###
It is also possible to use custom class names for each of the steps in your transitions. Instead of passing a string into transitionName you can pass an object containing either the `enter` and `leave` class names, or an object containing the `enter`, `enter-active`, `leave-active`, and `leave` class names. If only the enter and leave classes are provided, the enter-active and leave-active classes will be determined by appending '-active' to the end of the class name. Here are two examples using custom classes:
```javascript
@@ -94,7 +95,9 @@ It is also possible to use custom class names for each of the steps in your tran
enter: 'enter',
enterActive: 'enterActive',
leave: 'leave',
leaveActive: 'leaveActive'
leaveActive: 'leaveActive',
appear: 'appear',
appearActive: 'appearActive'
}>
{item}
</ReactCSSTransitionGroup>
@@ -102,7 +105,8 @@ It is also possible to use custom class names for each of the steps in your tran
<ReactCSSTransitionGroup
transitionName={
enter: 'enter',
leave: 'leave'
leave: 'leave',
appear: 'appear'
}>
{item2}
</ReactCSSTransitionGroup>
@@ -31,13 +31,16 @@ var ReactCSSTransitionGroup = React.createClass({
React.PropTypes.string,
React.PropTypes.shape({
enter: React.PropTypes.string,
leave: React.PropTypes.string
leave: React.PropTypes.string,
active: React.PropTypes.string
}),
React.PropTypes.shape({
enter: React.PropTypes.string,
enterActive: React.PropTypes.string,
leave: React.PropTypes.string,
leaveActive: React.PropTypes.string
leaveActive: React.PropTypes.string,
appear: React.PropTypes.string,
appearActive: React.PropTypes.string
})
]).isRequired,
transitionAppear: React.PropTypes.bool,