Comments (2)
Hi @AlexIoanGheorghita!
In fact all the animations run, but only translateY
resets the animated value to its initial value.
It means that in first loop you animate translateY
from translateY_initial_val
to 0
, opacityGroup
from opacityGroup_initial_val
to 1 etc.
And in the second loop you animate translateY
again from translateY_initial_val
to 0
(since function withRepeat is expected to restart the animated value), but you animate opacityGroup
from 1 to 1! This behaviour is expected.
I've created the following snippets of code to show you how to fix the problem
CODE | Recording |
const translateY = useSharedValue(100);
const translateX = useSharedValue(100);
useEffect(() => {
translateY.value = withRepeat(
withRepeat(
withSpring(0, { damping: 12, stiffness: 85 }, () => {
translateX.value = withTiming(translateX.value + 100, {
duration: 500,
});
})
)
);
}, [translateY, translateX]); |
Screen.Recording.2024-03-11.at.12.21.54.mov |
const translateY = useSharedValue(100);
const translateX = useSharedValue(100);
useEffect(() => {
translateY.value = withRepeat(
withRepeat(
withSpring(0, { damping: 12, stiffness: 85 }, () => {
translateX.value = 100;
translateX.value = withTiming(200, {
duration: 500,
});
})
)
);
}, [translateY, translateX]); |
Screen.Recording.2024-03-11.at.12.23.47.mov |
from react-native-reanimated.
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
from react-native-reanimated.
Related Issues (20)
- error while running the iOS app on Macos M1 HOT 3
- [Bug]: useAnimatedScrollHandler is not working properly with React Native FlashList in version 3.9+ HOT 5
- Entering/exiting dosen't works on android HOT 5
- useAnimatedScrollHandler with refreshControl not working HOT 3
- [Bug]: 3.10.0 - Uncaught exception 'NSUnknownKeyException', reason: '[<RCTUIManager 0x600002acc230> valueForUndefinedKey:] HOT 9
- Exception in Hostfunction: not implemented HOT 41
- onPress not work correctly HOT 4
- Shared transitions break when parent element uses justifyContent
- Property 'fill' was whitelisted both as UI and native prop. Please remove it from one of the lists. HOT 3
- SharedValue is an type of object, and sometimes a number HOT 6
- Animated.createAnimatedComponent() TypeError: Cannot read property 'remove' of undefined HOT 1
- [Android-IOS] [3.11.0] Animation update incorrect when setState after set shared value HOT 5
- NodesManager causing an app crash because of the "Map already consumed" HOT 2
- error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] HOT 3
- [Reanimated] Babel plugin exception: TypeError: (0 , types_12.cloneNode) is not a function HOT 1
- Unable to run on Android HOT 3
- ReferenceError: _updateDataSynchronously is not defined HOT 2
- [3.6.0] pod install error after upgrading 3.6.0 HOT 4
- Problems with react-native-reanimated v3.11.0 e react-native v 0.74.1 HOT 5
- Unable to resolve module ./publicGlobals HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-reanimated.