Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Console is throwing Unterminated JSX contents error [closed]

I am trying to set up a basic react example using jspm/systemjs and babel. I have this code here to show a simple page and am getting an error

import React from 'react';  export default React.createClass({ displayName: 'MainComponent', propTypes: {     item: React.PropTypes.object }, render: function render() {     return (         <div class="builder-conteiner">          <div>;     ); } });  React.render(<MainComponent />, document.getElementById('app')) 

Nothing is showing up, the console is throwing "Unterminated JSX contents", and babel is pointing to the react.render line:

 17 | React.render(<MainComponent />, document.getElementById('app'))     |                               ^  
like image 327
ajmajmajma Avatar asked Oct 14 '15 13:10

ajmajmajma


1 Answers

You have 2 unclosed <div> tags in your render() and a semicolon that probably doesn't belong. I'd get rid of those (e.g. close them, delete the semicolon in <div>; if it doesn't belong) and try it again.

like image 85
JMM Avatar answered Sep 30 '22 09:09

JMM