Each Block Typing Issue
See original GitHub issueI’m trying to iterate over a properties values by using {#each…}, and I have two typings (this is a TypeScript project) in my Svelte component.
<script lang="ts">
import Transition from './Transition/Transition.svelte';
type Options = { text: string, value?: string }[];
type OptionsGroup = Options[];
export let options: Options | OptionsGroup = [];
</script>
{#each options as option}
<div>example</div>
{/each}
I would expect the type of option in the each statement to be Options | OptionsGroup
but VS Code is giving me an error saying:
Argument of type ‘Options | OptionsGroup’ is not assignable to parameter of type ‘ArrayLike<{ text: string; value?: string; }>’.
I’m unsure of what exactly is going wrong as the build and dev tasks are working fine with no errors at all, it only seems to be an issue with VS Code.
System:
- OS: Manjaro (Linux)
- IDE: VSCode
- Plugin/Package: Svelte for VSCode
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
How to Solve Common Keyboard and Typing Problems
Here are answers to some of the most common typing problems, from disappearing text to jumping cursors.
Read more >Windows will not allow typing in the search or info blocks.
On my Laptop, latest Windows 10 Update installed. I have an issue that I can not input any information that requires typing!
Read more >Keyboard Gone Mad and Typing on Its Own? 6 Ways to Fix It ...
To prevent this, open the keyboard keys that are being pressed automatically and clean underneath them. This may resolve the problem. Subscribe ...
Read more >Unable to type in existing blocks in a Column - WordPress.org
I can reproduce the problem by placing the cursor anywhere within the text and pressing Shift while I click elsewhere in the text....
Read more >iOS 8 update causes keyboard to block text. Annoying!
to iOS 8 there have been issues with the keyboard blocking the text while typing and scrolling. It gets to a point where...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the clarification, I’ve amended my typings as recommend and that has pretty much solved it.
@dkzlv that’s #619