nested loops - must specify keys
See original GitHub issueexample:
props => pug`
for row, y in props.grid
for cell, x in row
span(key=y*row.length + x) #{cell}
`
workaround - use a flat array or insert a grouping element
props => pug`
for row, y in props.grid
div(key=y)
for cell, x in row
span(key=x) #{cell}
`
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Nested loops - access property: the key item should point to a ...
@hc_dev - I'm trying to loop both over users in admins list and for each user i want to add multiple ssh keys....
Read more >Nested Loops in C with Examples - GeeksforGeeks
A nested loop means a loop statement inside another loop statement. That is why nested loops are also called “loop inside loops“.
Read more >4.4. Nested For Loops — AP CSAwesome
A nested loop has one loop inside of another. These are typically used for working with two dimensions such as printing stars in...
Read more >Code.org Nested Loops in Maze All Answers Explained ...
Nested Loops in Maze is lesson 10 in Course D, lesson 11 in Course E, lesson 5 in Course F and lesson 8...
Read more >C Programming Tutorial - 39: Nested Loops - YouTube
In this tutorial we'll learn to use nested loops. Nested loops are loops within loops. We'll learn to use to loops to print...
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 Free
Top 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
@ForbesLindesay @KittenHero so, my intention here is to let pug not care about keys at all. I don’t see any reason to validate the code before transpiling, because even React throws warnings instead of errors (like we do).
BTW, if we let people transpile the code without keys, they will still see the warnings from React in DEV mode.
If you strongly disagree, let me know.
Done in v7.0.0
See how it works online
//CC @KittenHero