Skip to content

Missing "ownership_invalid_mutation" when using snippets ? #14145

@dm-de

Description

@dm-de

Describe the bug

I'm not sure... is this by design or not?

My example: LINK

I have a component, where I modify a received property.
One time it's directly inside component.
and another time it's inside snipped (which is also used in Component)

It has basically the same onclick - It will modify received data inside Component.
But only gray button produce a warning (missing ownership_invalid_mutation).
This do not happen, if I click snipped button (colored).

As I understand, we should not mutate received data.
Instead, we should use callback functions.
Right?

But... wow, I wish, we could officialy use such code... how beautiful is that to avoid callbacks?

We need clarity here... Perhaps quick response.
Otherwise, I don't know how to write right code now...

same code, but with callbacks:
LINK

Reproduction

see above

Logs

No response

System Info

Svelte 5.1.9

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions