ReactJS: “Uncaught SyntaxError: Unexpected token

UPDATE —
use this instead:

<script type="text/babel" src="https://stackoverflow.com/questions/28100644/./lander.js"></script>

Add type="text/jsx" as an attribute of the script tag used to include the JavaScript file that must be transformed by JSX Transformer, like that:

<script type="text/jsx" src="https://stackoverflow.com/questions/28100644/./lander.js"></script>

Then you can use MAMP or some other service to host the page on localhost so that all of the inclusions work, as discussed here.

Thanks for all the help everyone!

Leave a Comment