Skip to content

Commit d83bef1

Browse files
authored
Small update to Animations docs (facebook#4160)
This text appears to be referencing a class component that uses state to store the animated value. The example it is referencing is using function components, and the animated value is not state.
1 parent 5a2ae44 commit d83bef1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/animations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default () => {
130130
</TabItem>
131131
</Tabs>
132132

133-
Let's break down what's happening here. In the `FadeInView` constructor, a new `Animated.Value` called `fadeAnim` is initialized as part of `state`. The opacity property on the `View` is mapped to this animated value. Behind the scenes, the numeric value is extracted and used to set opacity.
133+
Let's break down what's happening here. In the `FadeInView` render method, a new `Animated.Value` called `fadeAnim` is initialized with `useRef`. The opacity property on the `View` is mapped to this animated value. Behind the scenes, the numeric value is extracted and used to set opacity.
134134

135135
When the component mounts, the opacity is set to 0. Then, an easing animation is started on the `fadeAnim` animated value, which will update all of its dependent mappings (in this case, only the opacity) on each frame as the value animates to the final value of 1.
136136

0 commit comments

Comments
 (0)