-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Description
Describe the problem
Lack of Type Information: $props doesn't inherently know what types the props should have unless explicitly specified.
Dynamic Nature of Props: Svelte allows any type of data to be passed as props, so without explicit definitions, TypeScript defaults to any.
Loose Typing in $props: $props is a generic utility, and its type must be explicitly constrained with a type parameter ($props<Type>()).
By following one of the options above, you can enforce strict typing and eliminate the any types in your $props.
Describe the proposed solution
Hovering over the variables would not have :any but the explicit type we passed into the prop.
Importance
nice to have
Metadata
Metadata
Assignees
Labels
No labels
