Skip to content

Conversation

holoflash
Copy link

@holoflash holoflash commented Oct 15, 2025

I came across this today and thought I might as well try and fix it.
The following wasn't triggering a warning, even though it should ( ? )

function EslintJsxKey() {
  const keylessItems = [];
  for (let i = 0; i < 4; i++) {
    keylessItems.push(<li>No Key!</li>);
  }
  return <ul>{keylessItems}</ul>;
}

While this is not the typical way one would do things in React, it felt like an easy one to handle so...why not?
Perhaps there's more to this that I've missed, and there's a good reason for why this wasn't done before.

Similar to:
#3937

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant