codedamn

React Basic Course- 33 Populating static list data

Asked by Kitt Cheung about a year ago

0

Im having a hard time figuring out what Im doing wrong. I cant pass the last challenge:

"You should use "people" prop in List component to pass the data and it should display the names"

this is what Ive so far: `import React from 'react'

const List = (props) => { const {people} = props return ( <> <h2>list component</h2> </> ) }

export default List`

what am I missing?

1 Answer

    1

    You are partially correct. You have to always map from a raw object or array before re initializing it.

    const List = (props) => { const { people } = props

    return people.map((person) => {
    	const { id, name, age, image } = person
    	return <article />
    })
    

    }

    @hardick

    Hardick Chatterjee

    @hardick

Your answer