Skip to content

Commit 16f0e5d

Browse files
committed
README update
1 parent e84950c commit 16f0e5d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
Testing [requirejs-babel](https://github.com/philix/jsx-requirejs-plugin)
44

5+
The project uses two plugins for React & JSX
6+
7+
* [jsx_requirejs_plugin]](https://github.com/philix/jsx-requirejs-plugin) - based on JSXTransformer
8+
* [requirejs-babel](https://github.com/philix/jsx-requirejs-plugin) - based on [Babel](http://babeljs.io/)
9+
10+
The fist one is working fine. The second one is not working. `require('es6!app/components/App')`
11+
is returning an empty object.
12+
13+
index.js:
14+
15+
```javascript
16+
define(function (require, exports, module) {
17+
var React = require('react');
18+
19+
var App = require('es6!app/components/App'); // this does not work!
20+
console.log('DEBUG App::',App);
21+
// => DEBUG App:: Object {}
22+
23+
//var App = require('jsx!app/components/App'); this is OK
24+
//console.log(React.createElement(App));
25+
// => ReactElement {type: function, key: null, ref: null, _owner: null, _context: Object…}
26+
27+
React.render(React.createElement(App), document.getElementById('app'));
28+
});
29+
```
30+
531

632
## Install
733

0 commit comments

Comments
 (0)