Console is throwing Unterminated JSX contents error [closed]
·
Answer a question
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'))
| ^
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.
更多推荐
所有评论(0)