Having trouble finding the right way to animate this Ui with react native reanimated #6666
Replies: 1 comment 1 reply
-
Hey @sidtechno-haris! I can see that you use the const orbitingStyles = orbitingUsers.map((user) =>
useAnimatedStyle(() => {
const angle = (user?.rotation?.value * Math.PI) / 180;
return {
transform: [
{ translateX: Math.cos(angle) * user?.radius },
{ translateY: Math.sin(angle) * user?.radius },
],
};
}, [orbitingUsers])
); I have 2 concerns here:
You will have to also change this loop where you render your users. Map over the {orbitingUsers.map((user, index) => (
// --- Move code below to the separate component ---
<Animated.View
key={user._id}
style={[styles.avatarContainer, orbitingStyles[index]]}>
<Image
source={require('../../../assets/user2.png')}
style={styles.avatarImage}
/>
{user.title && (
<Text style={styles.avatarName}>{user.title}</Text>
)}
</Animated.View>
))} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
UI is like a near share location and users will orbit around the orange image but when the data from the API renders it shows the error or length and i am facing this from a while please help me as if i have to change the animation or something.
packages detail:
"dependencies": { "@fawazahmed/react-native-read-more": "^3.0.4", "@notifee/react-native": "^9.1.2", "@react-native-async-storage/async-storage": "^2.0.0", "@react-native-community/geolocation": "^3.4.0", "@react-native-firebase/app": "^21.2.0", "@react-native-firebase/messaging": "^21.2.0", "@react-navigation/bottom-tabs": "^6.6.1", "@react-navigation/native": "^6.1.18", "@react-navigation/native-stack": "^6.11.0", "@tanstack/react-query": "^5.59.15", "i18next": "^23.15.1", "moment": "^2.30.1", "react": "18.3.1", "react-i18next": "^15.0.1", "react-native": "0.75.3", "react-native-android-location-enabler": "^2.0.1", "react-native-bouncy-checkbox": "^4.1.2", "react-native-calendars": "^1.1306.0", "react-native-gesture-handler": "^2.20.0", "react-native-heroicons": "^4.0.0", "react-native-image-picker": "^7.1.2", "react-native-keyboard-avoiding-scroll-view": "^1.0.1", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-maps": "^1.18.0", "react-native-permissions": "^4.1.5", "react-native-progress": "^5.0.1", "react-native-reanimated": "^3.15.3", "react-native-render-html": "^6.3.4", "react-native-safe-area-context": "^4.11.0", "react-native-screens": "^3.34.0", "react-native-svg": "^15.7.1", "socket.io-client": "^4.8.1" },
Beta Was this translation helpful? Give feedback.
All reactions