fix(confetti): prevent canvas worker reset on re-render and fix Confe…#992
Open
Wadiou wants to merge 1 commit into
Open
fix(confetti): prevent canvas worker reset on re-render and fix Confe…#992Wadiou wants to merge 1 commit into
Wadiou wants to merge 1 commit into
Conversation
|
@Wadiou is attempting to deploy a commit to the product-studio Team on Vercel. A member of the Team first needs to authorize it. |
Yeom-JinHo
self-requested a review
July 23, 2026 13:51
Member
|
@Wadiou Could we scope this PR to the worker-reset fix and split the portal out as a separate, opt-in change? |
…on ref forwarding - Preserve canvas worker context across parent component re-renders by storing globalOptions and options in refs. - Wrap ConfettiButton in forwardRef and extend ComponentPropsWithoutRef. - Restructure confetti.mdx documentation tables to accurately reflect manualstart, ConfettiRef, and options.
Author
|
@Yeom-JinHo Done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(confetti): prevent worker reset on re-render and fix ConfettiButton ref forwarding
Description
This PR fixes canvas worker context resets when parent components re-render, enables proper DOM ref forwarding for
ConfettiButton, and updates the prop tables in the documentation.Changes
Confettiwith stableoptionsRefandglobalOptionsRefto preserve WebGL/2D worker contexts across parent state updates and re-renders.ConfettiButtoninReact.forwardRefand extendedReact.ComponentPropsWithoutRef<typeof Button>.confetti.mdxprops table and usage code blocks to accurately reflectmanualstart,options,globalOptions, andConfettiRefimperative handle methods.Motivation
Previously, inline
globalOptionsdefaults causedConfetti's callback ref to trigger cleanup andreset()on every parent state update, permanently destroying the WebGL/2D canvas worker context mid-animation. Additionally,ConfettiButtondid not forward refs, and documentation listed particle props on<Confetti />directly instead ofoptions/ConfettiRef.Breaking Changes
None.