Skip to content

Commit 28f508d

Browse files
fix(animation): replace useAnimatedValue with Animated.Value to fix runtime error
Removed `useAnimatedValue` import from `react-native` and replaced `useAnimatedValue(0)` with `new Animated.Value(0)`. Reason: `useAnimatedValue` is not available in the current React Native version, causing the runtime error: TypeError: (0, _reactNative.useAnimatedValue) is not a function Using `Animated.Value` restores compatibility with the Animated API and keeps the fade animation working correctly.
1 parent 012ecef commit 28f508d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

website/versioned_docs/version-0.85/animated.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ import {
2323
View,
2424
StyleSheet,
2525
Button,
26-
useAnimatedValue,
2726
} from 'react-native';
2827
2928
const App = () => {
3029
// fadeAnim will be used as the value for opacity. Initial Value: 0
31-
const fadeAnim = useAnimatedValue(0);
30+
const fadeAnim = new Animated.Value(0);
3231
3332
const fadeIn = () => {
3433
// Will change fadeAnim value to 1 in 5 seconds

0 commit comments

Comments
 (0)