Skip to content

KonfettiView is unstable #316

@Nek-12

Description

@Nek-12
@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions