The following will animate from 1
to 2
.
const [props, set] = useSpring(() => ({ value:1 }));
set({value: 2});
However, let's assume Iwant the value to be instantly changed to 3
, and then animated to 2
, regardless of what it is currently. In other words, I'd like to avoid the smooth interpolation between 1 and 3.
const [props, set] = useSpring(() => ({ value:1 }));
set({value: 3, immediate: true}); //doesn't seem to work.
set({value: 3});
How do I do so?