我一直收到阻止应用启动的错误。我一直盯着这个,似乎无法找到问题。我确定这是一个非常愚蠢的错误,我会看看答案并大笑。
我收到此错误:
While processing files with jsx (for target web.browser):
client/components/App/App.jsx:30:4: client/components/App/App.jsx:
Unexpected token (30:4)
这是我的App.jsx文件:
App = React.createClass({
mixins: [ReactMeteorData],
getMeteorData() {
return {
loggedIn: !!Meteor.user()
}
},
showLayout() {
return (
<div className="row">
<div className="col-md-3">
{this.props.nav}
</div>
<div className="col-md-9">
{this.props.content}
</div>
</div>
)
},
showLogin() {
return (
<div className="row">
<div className="col-md-12 text-center">
<p>You must be logged in to do that.</p>
</div>
)
},
render() {
return (
<div className="container wrapper">
<div className="row">
{ this.allowedLayout() ? this.showLayout() : this.showLogin() }
</div>
</div>
)
}
});
答案 0 :(得分:1)
你忘了在这里关闭div:
<div className="row">
<div className="col-md-12 text-center">
<p>You must be logged in to do that.</p>
</div>
应该是:
<div className="row">
<div className="col-md-12 text-center">
<p>You must be logged in to do that.</p>
</div>
</div>