I am using react-spring. I am changing the background color which is working however I am hoping to do the following. Wait for 10 seconds then after those 10 seconds loop through the colors without the delay. I would also like to have a 1 second duration of each color.
currently my issue is that it waits 10 seconds then it starts to loop but makes me wait 10 seconds between every color change. Not sure what I am doing wrong
import {useSpring, animated} from 'react-spring';
const AnimatedView = animated(View);
const bgStyle = useSpring({
to: {backgroundColor: 'red'},
from: {backgroundColor: 'green'},
delay: 10000,
config: {duration: 1000},
loop: true,
});
return <AnimatedView style={bgStyle}>{props.children}</AnimatedView>;