You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In principle, component authors are not supposed to be able to render lists without keys. However, it turns out that it's possible using text nodes or comment nodes:
In principle, component authors are not supposed to be able to render lists without keys. However, it turns out that it's possible using text nodes or comment nodes:
Renders:
haha no key!haha no key!haha no key!
Renders:
<!-- haha no key! --><!-- haha no key! --><!-- haha no key! -->
Whereas if you use elements (e.g.
<div>
) instead of text/comment nodes, you get a compile-time error:At best, this is inconsistent, and at worst, it's a loophole in the intended behavior (lists must have keys).
The text was updated successfully, but these errors were encountered: