reactjs - How can we use react jsx templates in node-webkit -
reactjs - How can we use react jsx templates in node-webkit -
i'm having troubles using react's jsxtemplates in node-webkit. basic problem boils downwards this; using next code
react.createclass({ render:function(){ homecoming <h1>hello flux</h1> } }); will have node-webkit telling me
uncaught syntaxerror: unexpected token <
i have been searching , did not find satisfying solution. best thing came with, compiling jsx-based files proper js , storing them in separate directory (using gulp). solution annoys me means requiring files technically not there.
what other solutions there?
you can utilize node-jsx require .jsx files , parse them appropriately.
most simply, require , install so:
require('node-jsx').install({extension: '.jsx'})
and future files require .jsx extension parsed.
reactjs gulp node-webkit nw.js
Comments
Post a Comment