Open SonPH088 opened 3 years ago
Sure there is!
You'll want to do something like this (I haven't tested this).
const tickerRef = useRef(null)
<TextTicker ref={tickerRef}>My animated text</TextTicker>
<TouchableOpacity onPress={() => tickerRef.current.startAnimation()}>
<Text>Start ticker</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => tickerRef.current.stopAnimation()}>
<Text>Stop ticker</Text>
</TouchableOpacity>
Hi all!
is there any way to do the button with ref to pause the animation and play again the animation?
Many Thanks!