Paginator
The paginator is displayed on the screen by those four small dots. Its main purpose is to show the user which slide they're currently looking at while also displaying a sense of progress. This small component is not that hard to implement, but the features we're going to use to make sure this thing is working correctly are new to us.
One of the most important objects we're going to work with for this component is the Animated
object. This is needed because we're looking at animating the width and the opacity of our dots. This is also important because we want to make sure that the animation happens at the right moment. The right moment is, of course, while the user interacts with FlatList
. If your finger moves from right to left, we want the animation to also move at the same pace as your finger.
We're also going to use a cool new Hook called useRef
. This Hook is used when we need a mutable object that persists for the entire lifetime of your...