I'm trying to use 'react-native-app-intro-slider' with Lottie animations.
It works well, but when I click Back or Next button, the animation stops playing.
How can I re-play the animations?
Thanks in advance!
const renderItem = ({ item }) => {
return (
<View style={styles.container}>
<LottieView
ref={LottieRef}
autoPlay
loop
source={item.lottie}
/>
</View>
</ImageBackground>
)}
const slideChange = () => {
LottieRef.current.play(); // it doesn't work
}
useEffect(() => {
if (LottieRef.current !== null) {
LottieRef.current.play(); // it doesn't work
}
}, [LottieRef])
...
<AppIntroSlider
renderItem={renderItem}
data={slides}
onDone={onDone}
onSlideChange={slideChange}
showSkipButton
showPrevButton
/>