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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -