react-native-text-ticker
react-native-text-ticker copied to clipboard
Pause/Play The TEXT TICKER
Hi all!
is there any way to do the button with ref to pause the animation and play again the animation?
Many Thanks!
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>