简体   繁体   中英

React server rendering - how to use JSX?

I'm learning server-side rendering in React from this sample code: https://github.com/zertosh/ssr-demo-kit/blob/master/minimal/main.js

It's working great. But now I'm trying to rewrite the render method to use JSX, that's all. What do I have to do to make it work? I tried to look in many places, used node-jsx, but it didn't work. Thank you.

Use reactify to build the code and then start the server

After converting main.js in the demo to jsx, run these commands

 npm install reactify
 browserify -t reactify main.js --standalone Application --debug --outfile main-built.js
 npm start

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM