In React, an unexpected marker error occurs when I try to specify a constant, and I cannot understand why.
My code is pretty simple, and I almost exactly followed the bootstrap reaction examples 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 = (
<h3>Panel title</h3>
);
render() {
return (
<Panel collapsible expanded={this.state.open}>
<p>Body</p>
</Panel>
);
}
}
The error occurs titleimmediately after constand just saysSyntaxError: Unexpected Token
source
share