I'm trying to transpile my react jsx code into js using babel. This is the command I used:
npx babel BlueSlide/js/student_slider.jsx --watch --out-file BlueSlide/static/js/student_slider_compiled.js
When I do this I get this error
49 | render() {
50 | return (
> 51 | <div class="jumbotron thinking">
| ^
52 | <h1>Welcome To Blue Slide</h1>
53 | <p>How well do you understand what's going on</p>
54 | <div class="slidecontainer">
at Parser.raise (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:6344:17)
at Parser.unexpected (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:7659:16)
at Parser.parseExprAtom (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8828:20)
at Parser.parseExprSubscripts (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8413:23)
at Parser.parseMaybeUnary (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8393:21)
at Parser.parseExprOps (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8280:23)
at Parser.parseMaybeConditional (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8253:23)
at Parser.parseMaybeAssign (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8200:21)
at Parser.parseParenAndDistinguishExpression (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8963:28)
at Parser.parseExprAtom (/Users/joshua/Websites/BlueSlide/node_modules/@babel/parser/lib/index.js:8760:21) {
pos: 1356,
loc: Position { line: 51, column: 6 },
code: 'BABEL_PARSE_ERROR'
}
I tried replacing the inside of the render function with just a simple div and the same problem. I don't know why it's yelling at me for my render return statement.
I just want the react code to be compiled so that I can use it with my HTML and if this isn't the right way to do it, feel free to suggest an alternative.