I just started using React JS ... I\'m sorry but I am confused on what is the difference between type=\"text/babel\" and type=\"text/jsx\"
and when do I use them.. pleas
Babel is a transpiler that turns input code into "pure" JavaScript.
JSX is a syntax sugar over JavaScript. You write .jsx and transpile it to .js using a transpiler (typically, Babel).
When you write text/babel
you are saying to the Babel library that you want to transpile that script into pure JavaScript.
In case you write text/jsx
you are saying your script is in .jsx and you need a transpiler to parse your code.
If you want to write .jsx and/or ES6 without configuring a bundler like webpack or browserify, load Babel through a CDN and use text/babel
for simplicity.