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 trial

JavaScript

Syntax Error with ReactDom.render(); I can't find the issue

This is my code

```const Planet = (props)=>{

return( <div className="card"> <div> <img src={props.url} alt={props.name}> <div/> <h2>{props.name}</h2> <p>{props.desc}</p> <h3>Planet Profile</h3> <ul> <li><strong>Diameter:</strong> {props.diameter}</li> <li><strong>Moons:</strong> {props.moons}</li> </ul> <div/>

);

};

// 2: Create a container component that iterates over the planets array // and renders a 'Planet' component for each object in the array const PlanetList = (props)=> return( <div className="container"> {props.planets.map(planet =>

<Planet 

name={planet.name} moons= {planet.moons} desc={planet.desc} url ={planet.url} key={planet.id} diameter={planet.diameter}

/> ) }

</div>

);

// 3: Render the container component to the DOM ReactDom.render( <PlanetList planets={planets}/>,

document.getElementById('root')

);```

This is the error from dev tools.

```babel.js:14449 Uncaught SyntaxError: http://port-80-0qzcx4n3og.treehouse-app.com/app.js: Unterminated JSX contents (123:33) 121 | // 3: Render the container component to the DOM 122 | ReactDom.render(

123 | <PlanetList planets={planets}/>, | ^ 124 |
125 | document.getElementById('root') 126 |
at Parser.pp$5.raise (babel.js:14449) at Parser.pp$9.jsxReadToken (babel.js:16870) at Parser.<anonymous> (babel.js:17245) at Parser.readToken (babel.js:16065) at Parser.nextToken (babel.js:10761) at Parser.next (babel.js:10686) at Parser.eat (babel.js:10693) at Parser.pp.expect (babel.js:11744) at Parser.pp$9.jsxParseOpeningElementAt (babel.js:17145) at Parser.pp$9.jsxParseElementAt (babel.js:17164)```

1 Answer

this didn't post how i intended but i think it still makes sense hopefully someone can help me out