Meteor – unexpected token after Const

When I try to specify a constant, I receive an unexpected token error in React, and I can’t seem to figure out the reason.

My code is very simple, I almost completely followed the react-bootstrap example here.

My code is as follows:

import {Component, PropTypes} from 'react';

var rbs = require('react-bootstrap'),
Panel = rbs.Panel;

export default class ResumeSection extends Component {< br /> constructor(...args) {
super(...args);
this.state = {
open: true
};
}

const title = (

Panel title


);

render() {
return (< br />

Body



);
}
}

An error occurred directly after the const, and just said SyntaxError: Unexpected Token

You cannot define a const in the class body like that; it should be moved to a method.

render() {
const title = (

Panel title


);
// ...
}

When I try to specify a constant, I receive an unexpected token error in React, and I can’t seem to figure out the reason.

My code Very simple, I almost completely followed the react-bootstrap example here.

My code is as follows:

import {Component, PropTypes} from'react' ;

var rbs = require('react-bootstrap'),
Panel = rbs.Panel;

export default class ResumeSection extends Component {
constructor(...args) {
super(...args);
this.state = {
open: true
};
}

const title = (

Panel title


);

render() {
return (

Body



);
}
}< /pre>

An error occurred directly after const, and it just said SyntaxError: Unexpected Token

You cannot define one in the class body like that const; it should be moved to a method.

render() {
const title = (

Panel title< /h3>
);
// ...
}

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 575 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.