-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
feature requestNew feature or requestNew feature or request
Description
//component code
<script lang="typescript">
export let name= '';
</script>
when component is added without providing the Prop "name", vs code shows this error
component = Service
Type '{ service: Service; }' is not assignable to type 'IntrinsicAttributes & { service: Service; className: string; }'.
Property 'name' is missing in type '{ service: Service; }' but required in type '{ service: Service; name: string; }'
Currently I'm getting rid of this by adding explicit types
<script lang="typescript">
export let name: string | undefined = '';
</script>
we shouldn't have to do this right, can't we infer the type from the default value assignment?
or are there any other syntax (like '?') to make this more cleaner....
or am I doing something wrong?
Metadata
Metadata
Assignees
Labels
feature requestNew feature or requestNew feature or request