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
+31-20Lines changed: 31 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
[![npm][version-badge]][version]
4
4
[![MIT License][license-badge]][license]
5
5
6
-
Helpers that let you observe [Animated][animated] and [Reanimated][reanimated] values and convert between them using native events.
6
+
Helpers that let you observe [Animated][animated] and [Reanimated][reanimated] values and convert between them.
7
7
8
8
## Use case
9
9
@@ -23,19 +23,7 @@ The library exports the following components:
23
23
24
24
A component that converts between an [`Animated.Node`][animated.node] and a [`SharedValue<number>`][reanimated.sharedvalue] natively.
25
25
26
-
It accepts the following props:
27
-
28
-
-`from`: Value to read and observe changes from.
29
-
30
-
[`Animated.Node`][animated.node] - [`Animated.Value`][animated.value] or result of modifications such as interpolation (`Animated.AnimatedInterpolation`), addition (`Animated.AnimatedAddition`), etc.
31
-
32
-
[`SharedValue<number>`][reanimated.sharedvalue] or [`DerivedValue<number>`][reanimated.derivedvalue]
33
-
34
-
-`to`: Value to update when the `from` value changes.
35
-
36
-
[`Animated.Value`][animated.value] or [`SharedValue<number>`][reanimated.sharedvalue]
A component that observes changes in a given value and emits an event when the value changes. This is the building block for `AnimatedConverter`.
42
+
#### `from`
55
43
56
-
It accepts the following props:
44
+
Value to read and observe changes from. It can be one of the following:
45
+
46
+
-[`Animated.Node`][animated.node] - [`Animated.Value`][animated.value] or result of modifications such as interpolation (`Animated.AnimatedInterpolation`), addition (`Animated.AnimatedAddition`), etc.
47
+
-[`SharedValue<number>`][reanimated.sharedvalue] or [`DerivedValue<number>`][reanimated.derivedvalue]
48
+
49
+
#### `to`
57
50
58
-
-`value`: The value to observe. It can be a `number`, [`Animated.Node`][animated.node] for [Animated][animated], [`SharedValue<number>`][reanimated.sharedvalue] or [`DerivedValue<number>`][reanimated.derivedvalue] for [Reanimated][reanimated].
59
-
-`onValueChange`: A callback function that is called when the observed value changes.
51
+
Value to update when the [`from`](#from) value changes. It can be one of the following:
60
52
61
-
Usage:
53
+
-[`Animated.Value`][animated.value]
54
+
-[`SharedValue<number>`][reanimated.sharedvalue]
55
+
56
+
### `AnimatedObserver`
57
+
58
+
A component that observes changes in a given value and emits an event when the value changes. This is the building block for `AnimatedConverter`.
It can be a `number`, [`Animated.Node`][animated.node] for [Animated][animated], [`SharedValue<number>`][reanimated.sharedvalue] or [`DerivedValue<number>`][reanimated.derivedvalue] for [Reanimated][reanimated].
84
+
85
+
#### `onValueChange`
86
+
87
+
A callback function that is called when the observed value changes.
88
+
78
89
## How it works
79
90
80
91
The library renders a native component that receives an [`Animated.Node`][animated.node] or [`SharedValue<number>`][reanimated.sharedvalue] value. When the value changes, the library dispatches an event with this value.
0 commit comments