Ok so I have an issue where I've been following along with a Udacity course. The problem is the entire course app has been contained in one file and has steadily become harder and harder to pore through to find where issues are.
At some point an error has crept in, I think it's a syntax error, where I've added or missed out a bracket or something along those lines, but I can't find where it's happened.
I think it's specific to the below App component but can't see what I have done wrong.
The syntax highlighting in VS Code points to the below line where const is not highlighted as it is in other areas of the code.
const Context = React.createContext()
class App extends React.Component { const Context = React.createContext() class ConnectedApp extends React.Component { render() { return ( <Context.Consumer> {(store) => ( <App store={store}/> )} </Context.Consumer> ) } } class Provider extends React.Component { render() { <Context.Provider value={this.props.store}> { this.props.children } </Context.Provider> } } componentDidMount () { const { store } = this.props store.dispatch(handleIitialData()) store.subscribe( () => this.forceUpdate()) } render() { const { store } = this.props const { todos, goals, loading } = store.getState() if(loading) { return <h3>Loading</h3> } return( <div> < Todos todos={todos} store={this.props.store} /> < Goals goals={goals} store={this.props.store} /> </div> ) } } Error
babel.min.js:27 Uncaught SyntaxError: Inline Babel script: Unexpected token (108:18) 106 | class App extends React.Component { 107 | > 108 | const Context = React.createContext() | ^ 109 | 110 | class ConnectedApp extends React.Component { 111 | render() { at r.l.raise (babel.min.js:27) at r.c.unexpected (babel.min.js:27) at r.c.expect (babel.min.js:27) at r.m.parseMethod (babel.min.js:27) at r.parseClassMethod (babel.min.js:28) at r.m.parseClassBody (babel.min.js:27) at r.m.parseClass (babel.min.js:27) at r.m.parseStatement (babel.min.js:27) at r.parseStatement (babel.min.js:27) at r.m.parseBlockBody (babel.min.js:27)