How to use “grunt-react”
Auto translation from jsx to js

Tweet about this on TwitterShare on Facebook0Share on LinkedIn0Share on Google+0

React.js allows jsx scripting along with one of those translation tools like “JSXTransformer.js”.The “grunt-react” automates the conversion so that you only read a converted js file in your page.

Without grunt-react

HTML

JS

With grunt-react

We don’t need JSXTransformer.js anymore because grunt-react converts “jsx/main.jsx” (totally same contents as “main.js” above) to “js/main.js” of normal JS format. So only you need to do is to read react.js itself and the main.js.

HTML

Grunt config

Leave a Comment.