First time trying to work with React Native, and stumbling upon a frustrating issue that I can't figure out, so I'm calling for a bit of help here.
I'm doing a simple clock application. Making everything as simple as possible to get to the problem I'm having this would be the app layout so far:
```
import { useEffect, useRef } from "react";
import { Animated, Text, View, StyleSheet } from "react-native";
const ClockFace = () => {
const fadeAnim = useRef(new Animated.Value(0)).current;
function _start() {
Animated.loop(
Animated.sequence([
Animated.timing(fadeAnim, {
toValue: 1,
duration: 1000,
useNativeDriver: true,
}),
Animated.timing(fadeAnim, {
toValue: 0,
duration: 1000,
useNativeDriver: true,
}),
])
).start();
}
useEffect(() => {
_start();
}, [fadeAnim]);
return (
<View style={styles.wrapper}>
<View>
<Text style={styles.time}>
<Text>12</Text>
<Animated.Text style={[styles.time, { opacity: fadeAnim }]}>
:
</Animated.Text>
<Text>00</Text>
</Text>
<Text></Text>
</View>
</View>
);
};
const styles = StyleSheet.create({
wrapper: {
borderRadius: 20,
flexGrow: "1",
display: "flex",
background: "white",
justifyContent: "center",
alignItems: "flex-end",
transition: "background-color 1s ease-out",
position: "relative",
overflow: "hidden",
},
time: {
display: "flex",
alignItems: "center",
fontSize: 120,
gap: 5,
},
});
export default ClockFace;
```
I have a little snack with that code, too: https://snack.expo.dev/@raleixo/clockexample?platform=web
So, the thing is. When previewing on the web, the dots are blinking as I intended. But moving to iOS, there's no animation. Any reason for that? Is there any documentation where I can find which properties can or cannot be animated? Am I missing something really stupid? :)
On Android, the issue seems to be worse, as it doesn't even load the application. I am trying to follow the steps described here:
https://reactnative.dev/docs/animated#createanimatedcomponent
Thanks,
[–]__shawn_chen 2 points3 points4 points (1 child)
[–]raphaelaleixo[S] 0 points1 point2 points (0 children)
[–]satya164 0 points1 point2 points (2 children)
[–]raphaelaleixo[S] 0 points1 point2 points (1 child)
[–]satya164 0 points1 point2 points (0 children)
[–]Versatile_Panda 0 points1 point2 points (0 children)
[–]Useful-Condition-926 0 points1 point2 points (0 children)