(ReactJS) 在哪里下载 JSX 文件?

(ReactJS) Where to download the JSX file?

我正在尝试使用 JSX 语法开始使用 ReactJS。我查看了文档、检查了教程等,但无法找到包含所需 JSX 文件的任何下载。然而,在每个教程中,都有一个 link 到 React 15.1.0 的同一个官方下载,并且每个站点都声明那里应该有一个名为 JSXTransformer.js 的文件。但是没有。

谁能给我下载 link 真实的东西?谢谢

JSXTransformer 不再是 React 的一部分:

As many people have noticed already, React and React Native have both switched their respective build systems to make use of Babel. This replaced JSTransform, the source transformation tool that we wrote at Facebook.

来源:https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html

你要做的是使用 babel。有很多方法可以实现。

您可以使用gulp:https://jonsuh.com/blog/integrating-react-with-gulp/

您可以使用 browserify:http://codeutopia.net/blog/2016/01/25/getting-started-with-npm-and-browserify-in-a-react-project/

或者(我个人的选择)是使用webpack:http://jansoren.github.io/react-webpack-tutorial/

还值得一提的是,React 还提供了一个 "Starter Kit" 来帮助您入门,您可以在这里找到:https://facebook.github.io/react/docs/getting-started.html

JSXTransformer 已弃用 (https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html)。

最先进的方法是使用 Babel, using a builder tool such as Webpack (see http://survivejs.com/react/getting-started/setting-up-the-project/ and http://survivejs.com/webpack/introduction/), or Brunch (see http://github.com/brunch/with-react).

处理您的项目