Skip to content

Unactionable state_referenced_locally warning when $state(prop) #17296

@gyzerok

Description

@gyzerok

Describe the bug

I think there is at least one case where having this warning now is actually weird. When you initialize state with something from props I'd argue it is expected by the definition of how both $state rune and JS works, that your value will get out of sync with that prop. So in practice there is no way out of this warning except writing ignore comments above each of such lines. Would it make sense to suppress this case?

Image

Reproduction

REPL

Logs

System Info

irrelevant

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