question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nested loops - must specify keys

See original GitHub issue

example:

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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ezhlobocommented, Dec 12, 2018

@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.

0reactions
ezhlobocommented, Jan 8, 2019
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found