react-confetti
react-confetti copied to clipboard
Add frameRate prop to throttle FPS
Added new property frameRate. If provided, the request animation frame will still fire, but it will skip render frames to ensure the animation runs at the specified frame rate. By default frame rate is undefined, meaning it will work exactly as it did before.
I've added the property to storybook so you can play around with it.
This resolves #117
This behavior (speed on high refresh-rate screens) is described in MDN > requestAnimationFrame() method where they suggest tracking requestAnimationFrame callback's timestamp
The unthrottled frame rate is an issue and this fix tackles it for many new modern devices with high FPS. @alampros with the last release long ago, this is the perfect time to merge it in. Let's keep the library thriving by incorporating this much needed enhancement. Thanks for considering!