diff --git a/website/versioned_docs/version-0.71/animations.md b/website/versioned_docs/version-0.71/animations.md index e66b7c0b568..843d3a12f58 100644 --- a/website/versioned_docs/version-0.71/animations.md +++ b/website/versioned_docs/version-0.71/animations.md @@ -74,7 +74,7 @@ export default () => { ```SnackPlayer ext=tsx -import React, {useEffect} from 'react'; +import React, {useRef, useEffect} from 'react'; import {Animated, Text, View, useAnimatedValue} from 'react-native'; import type {PropsWithChildren} from 'react'; import type {ViewStyle} from 'react-native'; @@ -82,7 +82,7 @@ import type {ViewStyle} from 'react-native'; type FadeInViewProps = PropsWithChildren<{style: ViewStyle}>; const FadeInView: React.FC = props => { - const fadeAnim = useAnimatedValue(0); // Initial value for opacity: 0 +const fadeAnim = useRef(new Animated.Value(0)).current // Initial value for opacity: 0 useEffect(() => { Animated.timing(fadeAnim, {