Comment

Comment by peller

I'm not sure I follow. To use the basic example from the link, as opposed to this:

  const listItems = numbers.map((number) =>
    <li>{number}</li>
  );
  return (
    <ul>{listItems}</ul>
  );
What's wrong with looping this way?:

  return (
    <ul>
      {numbers.map((num, i) => <li key={i}>{num}</li>)}
    </ul>
  )
parent peller 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton