-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Binding implicitly typed boolean variables to a prop causes an error 👇
Error Message
Error: Type 'boolean' is not assignable to type 'false'. (ts)
{message}
isOpen={showModal}
on:handleNo={closeModal}
To Reproduce
Steps to reproduce the behavior:
- Create a variable in a component
export let isOpen = false;
- Bind this boolean variable to a boolean prop
<div id="modal" class="modal" class:is-active={isOpen}>
For example a code snippet that is treated in a way you don't expect.
Expected behavior
This should not cause an error.
If I revise it to explicitly be a boolean, it works without any errors.
export let isOpen: boolean = false;
But it should work with implicit booleans where we initialize to a boolean immediately as shown above.
System (please complete the following information):
- OS: macOS
- IDE: VSCode
- Plugin/Package: Svelte for VSCode and svelte-check
cc @orta as per our discussion
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