Skip to content

the contructor's props should be required if they contain a required prop #1578

@ivanhofer

Description

@ivanhofer

I have updated the description

Description

When using the JavaScript API to instantiate a Svelte component, I would find it useful to get an error if I forget to pass props.

image

In this case the Component has a required prop called title that expects a string.
I can completely omit the props attribute and won't get an error.

Proposed solution

Type the params object of the ComponentConstructorOptions to get errors when instantiating a component incorrectly.

Alternatives

No response

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions