@@ -33,13 +33,13 @@ class CommentList extends React.Component {
33
33
34
34
render ( ) {
35
35
const { $$comments } = this . props ;
36
- const commentNodes = $$comments . reverse ( ) . map ( ( $$comment , index ) => {
36
+ const commentNodes = $$comments . reverse ( ) . map ( $$comment => {
37
37
// `key` is a React-specific concept and is not mandatory for the
38
38
// purpose of this tutorial. if you're curious, see more here:
39
39
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
40
40
return (
41
41
< Comment
42
- key = { index }
42
+ key = { $$comment . get ( 'id' ) }
43
43
author = { $$comment . get ( 'author' ) }
44
44
text = { $$comment . get ( 'text' ) }
45
45
/>
@@ -50,14 +50,21 @@ class CommentList extends React.Component {
50
50
< div >
51
51
< ReactCSSTransitionGroup
52
52
transitionName = "element"
53
- transitionEnterTimeout = { 300 }
54
- transitionLeaveTimeout = { 300 }
53
+ transitionEnterTimeout = { 500 }
54
+ transitionLeaveTimeout = { 500 }
55
55
>
56
56
{ this . _errorWarning ( ) }
57
57
</ ReactCSSTransitionGroup >
58
- < div className = "commentList" >
58
+
59
+ < ReactCSSTransitionGroup
60
+ transitionName = "element"
61
+ transitionEnterTimeout = { 500 }
62
+ transitionLeaveTimeout = { 500 }
63
+ className = "commentList"
64
+ component = "div"
65
+ >
59
66
{ commentNodes }
60
- </ div >
67
+ </ ReactCSSTransitionGroup >
61
68
</ div >
62
69
) ;
63
70
}
0 commit comments