Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array of refs still not working for components #2774

Closed
PaulMaly opened this issue May 15, 2019 · 3 comments
Closed

Array of refs still not working for components #2774

PaulMaly opened this issue May 15, 2019 · 3 comments

Comments

@PaulMaly
Copy link
Contributor

Seems, this issue may be similar to #1916
Right now this works only for elements, not for components: https://svelte.dev/repl/6e952314892a491e860ca04fad9ed392?version=3.3.0

@mrkishi
Copy link
Member

mrkishi commented May 15, 2019

Closing as a duplicate of #2333.

@mrkishi mrkishi closed this as completed May 15, 2019
@PaulMaly
Copy link
Contributor Author

@mrkishi Seems, it's related issues but it's not duplicate, I think. Here I'm talking about using an array of refs inside {#each} block. The related issue about storing ref in object property without {#each} block.

@mrkishi
Copy link
Member

mrkishi commented May 15, 2019

Hi, Paul. The compiler chokes on the same exact line in both cases.

The issue isn't {#each}, but the property access. If you change it to this, the compilation no longer fails (although it wouldn't accomplish what you want, obviously!):

{#each items as item}
    <Item bind:this={variable}/>
{/each}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants