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
{{ message }}
Repository navigation
Commit 5b9e8d1
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: reason-react-native/src/apis/LayoutAnimation.md
+27-28Lines changed: 27 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
1
---
2
2
id: apis/LayoutAnimation
3
3
title: LayoutAnimation
4
-
wip: false
5
4
---
6
5
7
6
`LayoutAnimation` API offers a simpler alternative to `Animated` API. Instead of directly manipulating values for various style props, it suffices to specify the animation to be run before the next render. Specification of the animation should happen in the reducer, before `state` is updated.
`layoutAnimationConfig` can be created with the `layoutAnimationConfig` constructor
@@ -52,7 +50,6 @@ create:
52
50
```
53
51
54
52
55
-
56
53
`animationConfig` can in turn be created with the `animationConfig` constructor
57
54
58
55
```reason
@@ -76,8 +73,6 @@ animationConfig:
76
73
)
77
74
```
78
75
79
-
80
-
81
76
## Presets
82
77
83
78
There are presets for `linear`, `spring` and `easeInEaseOut` transitions which allow a very straightforward way to setup animation. Presets may either be passed as ready-made `layoutAnimationConfig` to `configureNext` and `configureNextWithEndCallback` as below
@@ -92,8 +87,6 @@ LayoutAnimation.spring()
92
87
93
88
```
94
89
95
-
96
-
97
90
## Example
98
91
99
92
The example below illustrates animated transition (`spring`) between two views, such as registration and login forms. Animation is specified in the reducer, as below. Making use of `presets` is also illustrated (commented out).
@@ -109,6 +102,14 @@ type state = {register: bool};
0 commit comments