Skip to content

Commit db1900a

Browse files
thommymotimdorr
authored andcommitted
Updated react-transition-group and changed Animation.js example (#5691)
* Updated to react-transition-group 2.2.1; * Changed implementation in example Animation.js
1 parent 5470fad commit db1900a

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

website/modules/examples/Animation.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { CSSTransitionGroup } from 'react-transition-group'
2+
import { CSSTransition, TransitionGroup } from 'react-transition-group'
33
import {
44
BrowserRouter as Router,
55
Route,
@@ -35,24 +35,26 @@ const AnimationExample = () => (
3535
</ul>
3636

3737
<div style={styles.content}>
38-
<CSSTransitionGroup
39-
transitionName="fade"
40-
transitionEnterTimeout={300}
41-
transitionLeaveTimeout={300}
42-
>
43-
{/* no different than other usage of
38+
<TransitionGroup>
39+
<CSSTransition
40+
classNames="fade"
41+
timeout = {300}
42+
key={location.key}
43+
>
44+
{/* no different than other usage of
4445
CSSTransitionGroup, just make
4546
sure to pass `location` to `Route`
4647
so it can match the old location
4748
as it animates out
48-
*/}
49-
<Route
50-
location={location}
51-
key={location.key}
52-
path="/:h/:s/:l"
53-
component={HSL}
54-
/>
55-
</CSSTransitionGroup>
49+
*/}
50+
<Route
51+
location={location}
52+
key={location.key}
53+
path="/:h/:s/:l"
54+
component={HSL}
55+
/>
56+
</CSSTransition>
57+
</TransitionGroup>
5658
</div>
5759
</div>
5860
)}/>

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"cheerio": "^0.22.0",
4848
"react-icons": "^2.2.3",
4949
"react-media": "^1.5.1",
50-
"react-transition-group": "^1.1.2",
50+
"react-transition-group": "^2.2.1",
5151
"resolve-pathname": "^2.0.2",
5252
"slug": "^0.9.1"
5353
}

0 commit comments

Comments
 (0)