$ git show marquee
Infinite marquee
A row of items scrolls sideways forever and loops without a seam. Good for logos and tickers.
// Two copies side by side; a CSS animation slides left by one copy's width, forever
const [w, setW] = useState(0);
const marquee = {
from: { transform: [{ translateX: 0 }] },
to: { transform: [{ translateX: -w }] },
};
<View style={{ overflow: 'hidden' }}>
<Animated.View
style={[{ flexDirection: 'row' }, w > 0 && {
animationName: marquee,
animationDuration: w * 25 + 'ms', // ~40 px/s whatever the content width
animationIterationCount: 'infinite',
animationTimingFunction: 'linear',
}]}>
<View style={{ flexDirection: 'row' }} onLayout={e => setW(e.nativeEvent.layout.width)}>{items}</View>
<View style={{ flexDirection: 'row' }}>{items}</View>
</Animated.View>
</View>
// Give every item the same trailing margin (no gap on the row) so the two copies tile exactly.