I have a syntax error in my code, and I'm not sure why. Does it have to do with the way I used refs?
export default class ToggleMenu extends React.Component {
showRight: function() {
this.refs.right.show();
}
render() {
return (
<div>
<button onClick={this.showRight}>Show Left Menu!</button>
{/*
<Menu ref="right" alignment="right">
<MenuItem hash="1">First</MenuItem>
<MenuItem hash="2">Second</MenuItem>
<MenuItem hash="3">Third</MenuItem>
</Menu>
*/}
</div>
);
}
}
Here is the error:
./src/components/ToggleMenu/
ToggleMenu.js
Module build failed: SyntaxError: Unexpected token (13:14)showRight: function() { this.refs.right.show(); }