Skip to content

Instantly share code, notes, and snippets.

@ShopifyEng
Created April 6, 2020 17:08
Building Arrive's Confetti in React Native with Reanimated - 9. Confetti 5 - createConfetti
// In createConfetti map
return {
key: i,
// Spawn confetti from two different sources, a quarter
// from the left and a quarter from the right edge of the screen.
x: new Animated.Value(
screenWidth * (i % 2 ? 0.25 : 0.75) - CONFETTI_SIZE / 2
),
y: new Animated.Value(-60),
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment