react-confetti icon indicating copy to clipboard operation
react-confetti copied to clipboard

Add frameRate prop to throttle FPS

Open kyleshay opened this issue 1 year ago • 2 comments

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

kyleshay avatar Jan 24 '24 00:01 kyleshay

This behavior (speed on high refresh-rate screens) is described in MDN > requestAnimationFrame() method where they suggest tracking requestAnimationFrame callback's timestamp

piotr-cz avatar Mar 12 '24 10:03 piotr-cz

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!

0xJerry avatar May 06 '24 00:05 0xJerry