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

[Static optimization] Allow key directive #4090

Closed
nolanlawson opened this issue Mar 21, 2024 · 1 comment · Fixed by #4091
Closed

[Static optimization] Allow key directive #4090

nolanlawson opened this issue Mar 21, 2024 · 1 comment · Fixed by #4091

Comments

@nolanlawson
Copy link
Contributor

nolanlawson commented Mar 21, 2024

Right now, for the following template:

<template>
    <table>
        <tbody>
            <template for:each={rows} for:item="row">
                <tr key={row.id}>
                    <td>hello</td>
                    <td>world</td>
                </tr>
            </template>
        </tbody>
    </table>
</template>

...we are not able to hoist the entire <tr> into a single static block, because the key directive disallows this.

We can potentially support the key directive – but only at the top level of the block. (Inside of the block, it's possible to use a key, but it's ignored with a warning: #3375)

Copy link

git2gus bot commented Mar 21, 2024

This issue has been linked to a new work item: W-15307004

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

Successfully merging a pull request may close this issue.

1 participant