Challenges

Rendering a List

Finally

Now we know how to render a list with React and most importantly understand this weird Javascriptish HTML code šŸ‘.

function TodoList(props) {
    return (
        <ul>
            {props.items.map((item, index) => (
                <li key={index}>{item}</li>
            ))}
        </ul>
        
    )
}

function Page() {
    const items = [
        "Learn JavaScript",
        "Learn React",
        "Learn Next.js"
    ]

    return (
        <div>
            <h1>My Todo List</h1>
            <TodoList items={items} />
        </div>
    )
}

šŸ™ We need your help

We need your help to keep maintain & add new content to this course. Here's how you can support us: