Web Development React.js Subjective
Sep 28, 2025

How do you render lists in React?

Detailed Explanation

Lists are rendered using the map() method to iterate over arrays and return JSX elements. Each list item should have a unique "key" prop.

function TodoList({ todos }) {
  return (
    <ul>
      {todos.map(todo => (
        <li key={todo.id}>{todo.text}</li>
      ))}
    </ul>
  );
}
Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback