-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code breaks #13
Comments
For on i feel there should be more to be done before the code works, the browser does not understand Component tags so it keeps throwing errors, i tried solving the issue above by using string literals |
No, the browser doesn't understand JSX, as explained in the blog posts, JSX needs to be transformed to function calls (
Before writing/adding JSX |
How do i get started with parcel bundler? |
@CeoFred for webpack, @plugins/transform-react-jsx is a must. no idea about parcel :) |
The simplest way to transform JSX to JS using Babel is: <div id="root"></div>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
// Didact code here
</script> |
yes, this is the simplest way |
Copied the whole code for a test and seems to be broken at the point where we try to do the actual work.
return (
<h1 onClick={() => setState(c => c + 1)}>
Count: {state}
)
At this point my browser says Uncaught SyntaxError: Unexpected token '<'at the point we want to render the html as JSX.
The text was updated successfully, but these errors were encountered: