Skip to content

Add note about having to call defineProps at the top-level #1990

Open
@darrylnoakes

Description

@darrylnoakes

When using defineProps, you have to call it in the form ... = defineProps().
Using it like ... = toRefs(defineProps()) generates a misleading mess of runtime errors, with the only relevant one being that "defineProps is not defined".
Currently, the docs for defineProps do not mention this at all.
Could a note be added, along with a ESLint rule?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions