-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
Description
Describe the bug
When the exactOptionalPropertyTypes flag is set to true in tsconfig.json I get errors when passing values to HTML elements which are possibly undefined which (presumably) shouldn't be happening.
To Reproduce
Steps to reproduce the behavior:
- Example:
<button on:click>Button</button>Type 'undefined' is not assignable to type 'MouseEventHandler<HTMLButtonElement>'.ts(2322)
(JSX attribute) svelte.JSX.DOMAttributes<HTMLButtonElement>.onclick?: svelte.JSX.MouseEventHandler<HTMLButtonElement>
- Example
<script lang="ts">
let placeholder: string | undefined;
</script>
<input {placeholder} />Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.ts(2322)
Expected behavior
All HTML properties should accept an undefined value. (?)
System (please complete the following information):
- OS: Linux
- IDE: VSCode
- Plugin/Package: Svelte for VSCode
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
