简体   繁体   English

如果我们使用reactify,是否需要安装`node-jsx`?

[英]Is it necessary to install `node-jsx` if we use reactify

In my Nodejs application, I use React. 在我的Node.js应用程序中,我使用React。 I browserify + reactify to transform .jsx files to js files. 我用browserify + reactify将.jsx文件转换为js文件。 I use this line of code in my entry js file : 我在我的入门js文件中使用以下代码行:

require('node-jsx').install();

I noticed that node-jsx is deprecated. 我注意到不推荐使用node-jsx Do I still need to have this line if I already reactify my react files ? 如果我已经对我的react文件进行了反应,是否还需要此行?

No, it is not necessary to use either node-jsx or JSXTransformer when using reactify. 不,使用reactify时不必使用node-jsx或JSXTransformer。 Reactify does all the transforms needed. Reactify完成所有需要的转换。

Most likely the reason node-jsx is deprecated is because it is a very bad idea to compile at runtime, as the browser has to download the entire compiler and the compiler will take time to load. 不推荐使用node-jsx的原因很可能是因为在运行时进行编译是一个非常糟糕的主意,因为浏览器必须下载整个编译器,并且编译器将花费一些时间来加载。 Always pre-compile JSX, babel, and coffeescript. 始终预编译JSX,babel和coffeescript。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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