Skip to content

Commit b3b2b53

Browse files
authored
Update animations.md
1 parent 617c156 commit b3b2b53

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/animations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ For example, a container view that fades in when it is mounted may look like thi
2121
<TabItem value="javascript">
2222

2323
```SnackPlayer ext=js&supportedPlatforms=ios,android
24-
import React, {useEffect} from 'react';
24+
import React, {useRef, useEffect} from 'react';
2525
import {Animated, Text, View} from 'react-native';
2626
2727
const FadeInView = props => {
28-
const fadeAnim = new Animated.Value(0); // Initial value for opacity: 0
28+
const fadeAnim = useRef(new Animated.Value(0)).current // Initial value for opacity: 0
2929
3030
useEffect(() => {
3131
Animated.timing(fadeAnim, {

0 commit comments

Comments
 (0)