You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,16 @@ that the transition duration must be specified in JavaScript as well as CSS.
28
28
Install via `npm`:
29
29
30
30
```
31
-
npm install --save react-css-transition-replace
31
+
npm install react-css-transition-replace
32
32
```
33
33
34
34
35
35
## Usage
36
36
37
37
A `ReactCSSTransitionReplace` component can only have a single child. Other than that, the basic usage
38
-
follows the exact same API as `ReactCSSTransitionGroup`. When the `key` of the child component changes, the
39
-
previous component is animated out and the new component animated in. During this process:
38
+
follows the exact same API as `ReactCSSTransitionGroup`, with support for `transitionEnter`, `transitionLeave`
39
+
and `transitionAppear`. When the `key` of the child component changes, the previous component is animated out
40
+
and the new component animated in. During this process:
40
41
41
42
- The leaving component continues to be rendered as usual with `static` positioning.
42
43
- The entering component is positioned on top of the leaving component with `absolute` positioning.
@@ -136,7 +137,9 @@ See the live example [here](http://marnusw.github.io/react-css-transition-replac
136
137
137
138
### Hardware acceleration for smoother transitions
138
139
139
-
For even smoother transitions, try to trigger hardware acceleration whenever possible. Here is an example of what you could do for a mobile app transition between pages:
140
+
For smoother transitions hardware acceleration, which is achieved by using translate3d instead of the 2D
141
+
translations, should be used whenever possible. For example, to realize a mobile app transition between
142
+
pages one might use:
140
143
141
144
```css
142
145
.page-enter, .page-leave {
@@ -164,15 +167,14 @@ For even smoother transitions, try to trigger hardware acceleration whenever pos
0 commit comments