So I have this component
import React from 'react';
import ReactDOM from 'react-dom';
import NeoHeader from './header/NeoHeader';
import NeoLoginModal from './modal/NeoLoginModal';
class Neo extends React.Component {
constructor(props) {
super(props);
this.state = {loginModal: false};
}
render() {
return( <NeoHeader/> { this.state.loginModal ? <NeoLoginModal /> : null })
}
}
ReactDOM.render(
<Neo/>,
document.getElementById('react-wrapper')
);
and as you can see, I'm trying to show the component NeoLoginModal when a state prop is set to true. However, building with Laravel mix gives an unexpected token error at the {this..} start. This is documented in multiple places as a correct way to do this, so what's the error about?