-
DedeepyaLikes 0Problem Description
Hi, I am working on react js just now. It’s critical for me to identify the bugs that I got. Could you please help me to identify the fix of this bug. (Uncaught SyntaxError: embedded: Unexpected token (9:27)). Here is my code.
var EmployeeGridRow = React.createClass({
render : function(){
return (
<tr>
<td>{{this.props.item.FirstName}}</td>
<td>{{this.props.item.LastName}}</td>
<td>{{this.props.item.EmailID}}</td>
<td>{{this.props.item.City}}</td>
<td>{{this.props.item.Country}}</td>
</tr>
);
}
});var EmployeeGridTable = React.createClass({
getInitialState : function(){
return {
items: []
}
},componentDidMount : function(){
$.get(this.props.dataUrl, function(data) {
if(this.isMounted()){
this.setState({
items : data
})
}
}.bind(this));
},render : function(){
var rows = [];
this.state.items.forEach(function(item){
rows.push(<EmployeeGridRow key={item.EmployeeID} item={item}/>);
});
return (<table className ="table table-border table-responsive">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email ID</th>
<th>City</th>
<th>Country</th>
</tr>
</thead>
<tbody></tbody>
</table>) ;
}
});ReactDOM.render(
<EmployeeGridTable dataUrl="/home/getEmployeeData"/>,
document.getElementById('griddata')
);
-
Sonar Systems adminLikes 0
Try putting a semi colon at the end of line 27
Login to reply