I am following a YT lecture to create a Skeleton.
But it's throwing an error undefined is not a function (near '..._reactNativeReanimated.default.sequence...')
react-native : 0.70.5
react-native-reanimated: 2.12.0
import { useEffect, useRef } from "react";
import { StyleSheet } from "react-native";
import Animated from "react-native-reanimated";
const Skeleton = () => {
const opacity = useRef(new Animated.Value(0.3));
useEffect(() => {
Animated.sequence([
Animated.timing(opacity.current, {
toValue: 1,
useNativeDriver: true,
duration: 500,
}),
Animated.timing(opacity.current, {
toValue: 0.3,
useNativeDriver: true,
duration: 800,
}),
]).start();
}, [opacity]);
return (
<Animated.View
style={[
styles.skeleton,
{ opacity: opacity.current, height: 100, width: 100 },
]}
/>
);
};
const styles = StyleSheet.create({
skeleton: {
backgroundColor: "red",
},
});
export default Skeleton;
Can we animate expo-linear-gradient ?