Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialIstvan Toth
14,348 PointsJust a little bit of code snippit for the future learner something is missing from the video 3/20/2023 a return at map
const App = (props) => {
return (
<div className="container">
{
props.planets.map(planet => {
return (<Planet
name={planet.name}
diameter={planet.diameter}
moons={planet.moons}
desc={planet.desc}
url={planet.url}
id={planet.id}
/>)
})
}
</div>
)
}
Istvan Toth
14,348 Points1 Answer
Travis Alstrand
Treehouse TeacherYes, I'm not sure exactly which video you're referring to. The code doesn't look familiar here. If you're watching this video, she doesn't use the return keyword here because she's performing an Implicit Return which you can read more about here.
I hope that this helps out, and thanks for sharing either way, very cool!
Istvan Toth
14,348 PointsTravis Alstrand
Treehouse TeacherIstvan Toth Oh I see, I'm sorry I was confusing this course with another and I forgot this was a React one. Yes, the return
keyword shouldn't be necessary here as it's only returning one single expression (component in our case). Were you experiencing errors on your end without it?
Steven Parker
231,248 PointsSteven Parker
231,248 PointsWhat course and lesson you are referring to? You might want to take a look at this video about Posting a Question.