JSX transformer causes errors
When I convert my response files using a converter from responsive tools
$ jsx public/dev/jsx public/prod/js --no-cache-dir
Or when I convert with grunt-react
$ grunt react
My production file is broken because the conversion uses React.createElement and the error says that this function is undefined.
<h1>{this.state.title}</h1>
converted to:
React.createElement("div", null, React.createElement("h1", null, this.state.title)
instead:
React.DOM.h1(null, this.state.title)
The live converter works fine because it uses React.DOM.h1(null, this.state.title) . This line of code works well with the reaction, but the React.createElement() function does not work and is not found.
How can I make my automatic converter, JSX or grunt, convert to React.DOM.h1(null) instead of React.createElement(h1, null) . Why does the converter use this feature?
source share