Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KonfettiView is unstable #316

Open
Nek-12 opened this issue Nov 18, 2023 · 0 comments
Open

KonfettiView is unstable #316

Nek-12 opened this issue Nov 18, 2023 · 0 comments

Comments

@Nek-12
Copy link

Nek-12 commented Nov 18, 2023

@Composable
fun KonfettiView(
    modifier: Modifier = Modifier,
    parties: List<Party>,
    updateListener: OnParticleSystemUpdateListener? = null
) 

The KonfettiView composable is non-skippable and non-restartable because the parties parameter is unstable, as well as OnParticleSystemUpdateListener

Soluiton:
Replace update listener with a lambda using rememberUpdatedState and wrap List<Parties> in an object that is marked as @Immutable

This issue has a serious performance impact as ConfettiView is being recomposed every time unrelated parameters change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant