Kevin Powell - CommunityKP-C
Kevin Powell - Community2y ago
9 replies
vic

map function and key props error in react js

so im new with reactjs , heres the code
const projectDetails=[
        {
            image:assestObj.skullcandyLogo,
            title:"Skullcandy",
            desc:"A focused Web Developer building Websites "
        },
        {
            image:assestObj.skullcandyLogo,
            title:"Skullcandy2",
            desc:"Desc2"
        }
    ]
    return(
        <div id="project-container">
            <p id="project-p">Projects</p>

        {projectDetails.map((elem,index)=>{
        return <div id="project-section">
                <div id="project-img">
                    <img src={elem.image} id="project-logo" key={`img-${index}`} alt="skullcandy" />  
                 </div>
                <div id="project-texts">
                    <p id="project-title" key={`p-${index}`}> {elem.title} </p>
                    <p id="project-desc" key={`p1-${index}`}> {elem.desc} </p>
                </div>
            </div>
            })}
        </div>
    )
}


the error is in image
Screenshot_121.png
Was this page helpful?