Uncaught SyntaxError: Unexpected token '<'
complete
Alina Fatima
problem I'm getting is when including files with React components into the "customJS", it gives an error
for example for the file:
const React = window.unlayer.React
class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}
it gives the error
Uncaught SyntaxError: Unexpected token '<'
Alina Fatima
<h1>Hello, {this.props.name}</h1> needs to be in back ticks:
<h1>Hello, {this.props.name}</h1>
This post was marked as
complete
This post was marked as
in progress