The following example works:
const progress = useDerivedValue(() => withTiming(1));
The following crashes:
const progress = useDerivedValue(() => repeat(withTiming(1), -1, true));
I'm trying to achieve maximum composability between between animations and would like to write the following:
const paused = useSharedValue(false);
const progress = useDerivedValue(() => withPause(repeat(withTiming(1), -1, true)), paused);
I also have a concern about the boilerplate required to build custom animations. While I was able to build a custom animation outside reanimated 2, animations defined in animation.js seem to use boilerplate that might be useful to other animations (namely defineAnimation())
@wcandillon does this problem still occur? I just tried it out and it worked just fine, can you confirm?
Thanks for following up on this, closing it.
I can confirm that the behaviour still happens:
const progress = useSharedValue(0);
useLayoutEffect(() => {
progress.value = repeat(withTiming(1, {duration: 400}), -1, true);
}, [progress.value]);
Closing again, looks this has been fixed.