So, I figured it out myself.
I got the necessary files and instructions from this repo: jsx-requirejs-plugin .
As soon as I had the jsx plugin and a modified version of JSXTransformer , I changed my code according to the instructions in the repository:
require.config({ // ... paths: { "react": "path/to/react", "JSXTransformer": "path/to/JSXTransformer", "jsx": "path/to/jsx plugin" ... } // ... });
Then I could reference the JSX files using the jsx! plugin jsx! . For example, to download the Timer.jsx file located in the components directory:
require(['react', 'jsx!components/Timer'], function (React, Timer) { ... React.renderComponent(<Timer />, document.getElementById('timer')); ... });
I could also access .js files that had jsx syntax in them using the same code:
require(['react', 'jsx!components/Timer'], function (React, Timer) { ... React.renderComponent(<Timer />, document.getElementById('timer')); ... });
In addition, I did not have to place /** @jsx React.DOM */ at the top of the files using jsx syntax.
Hope this helps.
myusuf Apr 30 '14 at 9:42 2014-04-30 09:42
source share