Skip to content

Commit 5577203

Browse files
authored
Update animations.md
1 parent 7e639cd commit 5577203

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

website/versioned_docs/version-0.80/animations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ export default () => {
7474
<TabItem value="typescript">
7575

7676
```SnackPlayer ext=tsx
77-
import React, {useEffect} from 'react';
78-
import {Animated, Text, View, useAnimatedValue} from 'react-native';
77+
import React, {useRef, useEffect} from 'react';
78+
import {Animated, Text, View} from 'react-native';
7979
import type {PropsWithChildren} from 'react';
8080
import type {ViewStyle} from 'react-native';
8181
8282
type FadeInViewProps = PropsWithChildren<{style: ViewStyle}>;
8383
8484
const FadeInView: React.FC<FadeInViewProps> = props => {
85-
const fadeAnim = useAnimatedValue(0); // Initial value for opacity: 0
85+
const fadeAnim = useRef(new Animated.Value(0)).current // Initial value for opacity: 0
8686
8787
useEffect(() => {
8888
Animated.timing(fadeAnim, {

0 commit comments

Comments
 (0)