I'm getting an error for the following code:
{this.props.mountedPage === "frontpage" ?
<Navbar className="navbar-nomargin"> :
<Navbar>}
Error message: Error - Parsing error: Unexpected token .
Refers to the first dot in this.props.mountedPage
I have something similar a few lines down and it's working fine without any lint errors:
{this.props.mountedPage === "frontpage" ?
<NavItem href="/#services">Tjänster</NavItem>
: null}
EDIT:
Thanks for the suggestions, you were right, the linter failed to close the tag properly. I ended up moving the rendering of elements to a separate function so that the tag would close properly:
render: function() {
return (
this.props.mountedPage == "frontpage" ?
<Navbar className="navbar-nomargin">{this.renderBody()}</Navbar> :
<Navbar>{this.renderBody()}</Navbar>
);
}