If you write React.js components you have the choice to use JSX or plain JS, as JSX compiles to plain JS anyway.
- It leads to more verbose files.
- While writing the code you already see the final React classes.
- You cannot just copy and paste some HTML into your component and be done (Although even with JSX you’d also have to adjust some things like changing
- Inline JS logic is easier to write, as it’s JS all the time, not markup + JS
- You can ignore any compile step and use your JS file just as you’re used to
Recently I switched back to using JSX. I started writing bigger components as React classes. The XML like tree structure was very welcome. Also I could grab existing HTML and transform it into a React class more quickly.
Read more about JSX on Github
What are your experiences with ReactJS? Do you use JS or JSX?