Skip to content

Instantly share code, notes, and snippets.

@reime005
Created January 12, 2021 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reime005/cb84d432d8a827c7f359abfc9062ff6e to your computer and use it in GitHub Desktop.
Save reime005/cb84d432d8a827c7f359abfc9062ff6e to your computer and use it in GitHub Desktop.
...
<Animated.View
onLayout={(e) => {
animatedWidth.current = e.nativeEvent.layout.width;
}}
style={{ flexDirection: 'row' }}
{...starPanResponder.panHandlers}>
{Array.from({ length: 5 }).map((_, i) => {
return (
<Star
key={i}
size={70}
distance={8}
offset={offset - i} // local state
/>
);
})}
</Animated.View>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment