Skip to content

svelte2tsx each block typing #298

@jasonlyu123

Description

@jasonlyu123

Describe the bug
svelte2tsx use Array.map to mimic each block now but the svelte compiler use for-loop to iterate.

quote doc:

You can use each blocks to iterate over any array or array-like value — that is, any object with a length property.

To Reproduce
Steps to reproduce the behavior:

https://svelte.dev/repl/c7b9f67bfbe24c5dbc06407140618b84?version=3.24.0

Expected behavior
create another map/forEach function that accepts arrayLike interface to wrap it

Screenshots
If applicable, add screenshots to help explain your problem.
圖片

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions