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
Try using this component in your app and tap the box. The component should automatically interpolate between the two styles - including using predefined animations that should work for the different style properties.
@@ -70,7 +72,7 @@ API reference for `Fluid.*` components:
70
72
- Fluid.Text
71
73
- Fluid.ScrollView
72
74
73
-
### Fluid.*
75
+
### Fluid.\*
74
76
75
77
`Fluid.*` components are the basic building blocks of react-native-fluid-transitions. They all implement the same properties as their corresponding React Native components.
76
78
@@ -101,34 +103,36 @@ If you want more control over how animations are played, you can build your own
101
103
102
104
A simple example illustrates how states and configuration can be used to build transitions:
A fluid state works as a regular React Native state, and can be created with the hook <ahref="#useFluidState">`useFluidState`</a>. It returns a state variable and a function for updating the state. This object can be passed along to the Fluid.View through the state property.
@@ -153,7 +157,6 @@ A configuration object consists of the following types:
153
157
| childAnimation | Describes how child animations should be ordered |
154
158
| interpolation | Describes interpolations that should be on at all times. Typically used for interpolations that are driven by a ScrollView or gesture. |
155
159
156
-
157
160
#### <aname="When">When</a>
158
161
159
162
The when configuration field can contain different types of configuration. The when configuration field is created using the `WhenState` function. This function has several different overloads:
@@ -210,13 +213,12 @@ An animation type is a description of the animation function to run a given anim
| duration | Duration in number of milliseconds | number |
220
+
| delay | Delay before starting the animation in milliseconds | number (optional) |
221
+
| easing | Curve to apply to the animation | Easing (optional) |
220
222
221
223
**Spring Animation**
222
224
@@ -234,7 +236,7 @@ If you want an interpolation to run when a state change occurs, you can add `OnE
234
236
**Creates a new onEnter / onExit element describing the interpolation that should be run when the state changes to / from active.**
235
237
236
238
```js
237
-
function (state, interpolation, options?)
239
+
function (state, interpolation, options?)
238
240
```
239
241
240
242
Where the parameters <a href="#States">state</a>, <a href="#InterpolationType">interpolation</a> and <a href="#Options">options</a> shares the same types as the `When` element.
When animations are played in the context of a parent `Fluid.View`, you can control how these animations should be played by changing the child configuration. There are three different types of child configuration available:
One of the more advanced techniques when building animations and transitions in React Native is when you need your interpolation to depend on a gesture value or a scrolliew position. In `react-native-fluid-transitions` this is already taken care of for you.
272
275
273
276
Given a view tree that contains a header and a scroll view:
Copy file name to clipboardExpand all lines: package.json
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
"version": "0.1.1",
4
4
"private": true,
5
5
"scripts": {
6
+
"bootstrap": "yarn && cd ios && pod install && cd .. && cd src/packages/animated && tsc && cd ../transitions && tsc && cd ../gestures && tsc && cd ../navigation && tsc && cd ../svg && tsc && cd ..",
0 commit comments